Skip to content

Commit

Permalink
fix: replace internal redux wrapper with new util
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasLohoff committed Nov 3, 2022
1 parent b122efd commit 9603646
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/components/AddLayerModal/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import React from 'react';

import {
getByRole,
render,
screen,
fireEvent
} from '@testing-library/react';

import {
Provider
} from 'react-redux';

import {
show,
hide
Expand All @@ -20,18 +15,9 @@ import {
store
} from '../../store/store';

import AddLayerModal from './index';
import { createReduxWrapper } from '../../utils/testUtils';

const createWrapper = () => {
// eslint-disable-next-line react/display-name
return ({
children
}: any) => (
<Provider store={store}>
{children}
</Provider>
);
};
import AddLayerModal from './index';

describe('<AddLayerModal />', () => {

Expand All @@ -51,15 +37,15 @@ describe('<AddLayerModal />', () => {
const {
container
} = render(<AddLayerModal />, {
wrapper: createWrapper()
wrapper: createReduxWrapper()
});

expect(container).toBeVisible();
});

it('can toggle its visibility', () => {
render(<AddLayerModal />, {
wrapper: createWrapper()
wrapper: createReduxWrapper()
});

const modal = screen.getByRole('dialog');
Expand Down

0 comments on commit 9603646

Please sign in to comment.