Skip to content

Commit

Permalink
test de App.js
Browse files Browse the repository at this point in the history
  • Loading branch information
uo283182 committed Apr 22, 2024
1 parent 5f0c9d7 commit 041f34d
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions webapp/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { render, screen } from '@testing-library/react';
import { render, screen,waitFor } from '@testing-library/react';
import { BrowserRouter} from 'react-router-dom';
import App from './App';

test('renders learn react link', () => {
render(
<BrowserRouter>
<App/>
</BrowserRouter>
);
describe('App component', () => {

it('renders learn react link',async () => {
render(
<BrowserRouter>
<App/>
</BrowserRouter>
);

// Esperamos que se muestre el boton de cerrar sesión
await waitFor(() => {
const navElement = screen.getByRole('navigation');
expect(navElement).toBeInTheDocument();
expect(screen.getByText(/Cerrar sesión/i)).toBeInTheDocument();
});
});

});

0 comments on commit 041f34d

Please sign in to comment.