Skip to content

Commit

Permalink
test to access to history
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288574 committed Apr 22, 2024
1 parent ef8150d commit bd0443f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion webapp/src/components/nav/Nav.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, screen } from '@testing-library/react';
import { render, screen, fireEvent } from '@testing-library/react';
import { ContextFun } from '../Context';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
Expand Down Expand Up @@ -27,5 +27,22 @@ describe("Nav component", () => {
expect(linkElement).toBeInTheDocument();
});

test("renders nav, access to history",async () => {

render(
<ContextFun>
<Router>
<Nav/>
</Router>
</ContextFun>
);

const linkElement = screen.getByText(/Historial/i);
fireEvent.click(linkElement);

const textOnPage = screen.getByText(/Historial de/i);
expect(textOnPage).toBeInTheDocument();
});

});

0 comments on commit bd0443f

Please sign in to comment.