Skip to content

Commit

Permalink
Version mejorada test
Browse files Browse the repository at this point in the history
  • Loading branch information
UO290054 committed Mar 11, 2024
1 parent a27f554 commit 965c9c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions webapp/src/components/AddUser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ describe('AddUser component', () => {
});
});
*/

import AddUser from './AddUser';
import React from 'react';
import { render } from '@testing-library/react';
import AddUser from './AddUser';
import { BrowserRouter } from 'react-router-dom'; // Import BrowserRouter

describe('./AddUser', () => {
it('should render the component without crashing', () => {
// Render the component
render(<AddUser />);

describe('./AddUser', () => {
it('should render the Login component without crashing', () => {
// Wrap Login within BrowserRouter to provide routing context
render(<BrowserRouter><AddUser /></BrowserRouter>);
});
});

10 changes: 5 additions & 5 deletions webapp/src/components/Login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ describe('Login component', () => {

import React from 'react';
import { render } from '@testing-library/react';
import Login from './Login';;
import { BrowserRouter } from 'react-router-dom'; // Import BrowserRouter
import Login from './Login'; // Assuming Login is the component under test

describe('./Login', () => {
it('should render the component without crashing', () => {
// Render the component
render(<Login />);

it('should render the Login component without crashing', () => {
// Wrap Login within BrowserRouter to provide routing context
render(<BrowserRouter><Login /></BrowserRouter>);
});
});

0 comments on commit 965c9c3

Please sign in to comment.