From c1b4e74c63b561bbd8086a831f1e19e8a622b9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Fern=C3=A1ndez?= Date: Sat, 6 Apr 2024 16:25:46 +0200 Subject: [PATCH] Agregados tests Primera.js --- webapp/src/components/Primera.test.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/Primera.test.js b/webapp/src/components/Primera.test.js index b5fc683d..03239645 100644 --- a/webapp/src/components/Primera.test.js +++ b/webapp/src/components/Primera.test.js @@ -1,8 +1,18 @@ import { render, screen } from '@testing-library/react'; +import { BrowserRouter as Router } from 'react-router-dom'; import Primera from './Primera'; -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/Saber y Ganar: El Juego/i); - expect(linkElement).toBeInTheDocument(); +describe('Primera component', () => { + it('should render the title', () => { + render(); + const title = screen.getByText(/Saber y Ganar: El Juego/i); + expect(title).toBeInTheDocument(); + }); + + it('should render the login link', () => { + render(); + const loginLink = screen.getByText(/INICIAR SESIÓN/i); + expect(loginLink).toBeInTheDocument(); + expect(loginLink).toHaveAttribute('href', process.env.RUTA_LOGIN || '/login'); + }); }); \ No newline at end of file