Skip to content

Commit

Permalink
Agregados tests Primera.js
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287998 committed Apr 6, 2024
1 parent d2acf26 commit c1b4e74
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions webapp/src/components/Primera.test.js
Original file line number Diff line number Diff line change
@@ -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(<Primera />);
const linkElement = screen.getByText(/Saber y Ganar: El Juego/i);
expect(linkElement).toBeInTheDocument();
describe('Primera component', () => {
it('should render the title', () => {
render(<Router><Primera /></Router>);
const title = screen.getByText(/Saber y Ganar: El Juego/i);
expect(title).toBeInTheDocument();
});

it('should render the login link', () => {
render(<Router><Primera /></Router>);
const loginLink = screen.getByText(/INICIAR SESIÓN/i);
expect(loginLink).toBeInTheDocument();
expect(loginLink).toHaveAttribute('href', process.env.RUTA_LOGIN || '/login');
});
});

0 comments on commit c1b4e74

Please sign in to comment.