Skip to content

Commit

Permalink
Updated tests to use BrowserRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Jul 26, 2023
1 parent 2d117ac commit 40e745f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@
import React from 'react';
import { render } from 'wrappedTestingLibrary';
import { IntlProvider } from 'react-intl';
import { Router } from 'react-router-dom';
import history from 'util/History';
import { BrowserRouter } from 'react-router-dom';
import ButtonToEventDefinition from './ButtonToEventDefinition';

describe('<ButtonToEventDefinition>', () => {
it('should not fail', () => {
render(<IntlProvider locale="en">
<Router history={history}>
<BrowserRouter history={history}>
<ButtonToEventDefinition target="645e2702a840630f365f59ab" />
</Router>
</BrowserRouter>
</IntlProvider>);
});
});
7 changes: 3 additions & 4 deletions src/web/wizard/pages/NewAlertListPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

import React from 'react';
import { render } from 'wrappedTestingLibrary';
import { Router } from 'react-router-dom';
import history from 'util/History';
import { BrowserRouter } from 'react-router-dom';

import NewAlertListPage from './NewAlertListPage';

jest.mock('routing/Routes', () => ({ pluginRoute: () => '/route' }));

describe('<NewAlertListPage>', () => {
it('should not fail', () => {
render(<Router history={history}>
render(<BrowserRouter history={history}>
<NewAlertListPage />
</Router>);
</BrowserRouter>);
});
});

0 comments on commit 40e745f

Please sign in to comment.