diff --git a/__mocks__/store.js b/__mocks__/store.js new file mode 100644 index 00000000..0ceb53cc --- /dev/null +++ b/__mocks__/store.js @@ -0,0 +1,23 @@ +jest.mock('store', () => { + let state = {} + + const mockUseStore = (selectorFn) => { + return selectorFn(state) + } + + mockUseStore.setState = (newState) => { + state = { + ...state, + ...newState, + } + } + + mockUseStore.clearState = () => { + state = {} + } + + return { + __esModule: true, + default: mockUseStore, + } +}) diff --git a/__tests__/Footer.test.tsx b/__tests__/Footer.test.tsx index 650e253f..d68cd3a8 100644 --- a/__tests__/Footer.test.tsx +++ b/__tests__/Footer.test.tsx @@ -1,16 +1,14 @@ -import { shallow } from 'enzyme' +import { render } from '@testing-library/react' import Footer from 'components/Footer' -import Text from 'components/Text' import packageJSON from '../package.json' describe('