diff --git a/web/src/js/__tests__/components/Modal/ModalSpec.js b/web/src/js/__tests__/components/Modal/ModalSpec.js new file mode 100644 index 000000000..e4880d084 --- /dev/null +++ b/web/src/js/__tests__/components/Modal/ModalSpec.js @@ -0,0 +1,30 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import Modal from '../../../components/Modal/Modal' +import { Provider } from 'react-redux' +import { TStore } from '../../ducks/tutils' + +describe('Modal Component', () => { + let store = TStore() + + it('should render correctly', () => { + // hide modal by default + let provider = renderer.create( + + + + ), + tree = provider.toJSON() + expect(tree).toMatchSnapshot() + + // option modal show up + store.getState().ui.modal.activeModal = 'OptionModal' + provider = renderer.create( + + + + ) + tree = provider.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap b/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap new file mode 100644 index 000000000..f25c33301 --- /dev/null +++ b/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Modal Component should render correctly 1`] = `
`; + +exports[`Modal Component should render correctly 2`] = ` +
+
+ +`;