diff options
-rw-r--r-- | web/src/js/__tests__/components/Header/FileMenuSpec.js | 15 | ||||
-rw-r--r-- | web/src/js/__tests__/components/Header/__snapshots__/FileMenuSpec.js.snap | 13 |
2 files changed, 27 insertions, 1 deletions
diff --git a/web/src/js/__tests__/components/Header/FileMenuSpec.js b/web/src/js/__tests__/components/Header/FileMenuSpec.js index 65b4647a..0d87530b 100644 --- a/web/src/js/__tests__/components/Header/FileMenuSpec.js +++ b/web/src/js/__tests__/components/Header/FileMenuSpec.js @@ -8,13 +8,20 @@ describe('FileMenu Component', () => { let clearFn = jest.fn(), loadFn = jest.fn(), saveFn = jest.fn(), + openModalFn = jest.fn(), mockEvent = { preventDefault: jest.fn(), target: { files: ["foo", "bar "] } }, createNodeMock = () => { return { click: jest.fn() }}, fileMenu = renderer.create( - <FileMenu clearFlows={clearFn} loadFlows={loadFn} saveFlows={saveFn}/>, { createNodeMock }), + <FileMenu + clearFlows={clearFn} + loadFlows={loadFn} + saveFlows={saveFn} + openModal={openModalFn} + />, + { createNodeMock }), tree = fileMenu.toJSON() it('should render correctly', () => { @@ -42,4 +49,10 @@ describe('FileMenu Component', () => { a.props.onClick(mockEvent) expect(saveFn).toBeCalled() }) + + it('should open optionModal', () => { + let a = ul.children[3].children[1] + a.props.onClick(mockEvent) + expect(openModalFn).toBeCalled() + }) }) diff --git a/web/src/js/__tests__/components/Header/__snapshots__/FileMenuSpec.js.snap b/web/src/js/__tests__/components/Header/__snapshots__/FileMenuSpec.js.snap index 13ecf3f5..15c1afbc 100644 --- a/web/src/js/__tests__/components/Header/__snapshots__/FileMenuSpec.js.snap +++ b/web/src/js/__tests__/components/Header/__snapshots__/FileMenuSpec.js.snap @@ -63,6 +63,19 @@ exports[`FileMenu Component should render correctly 1`] = ` </li> <li> + <a + href="#" + onClick={[Function]} + > + <i + className="fa fa-fw fa-cog" + /> + Options + </a> + + </li> + <li> + <hr className="divider" /> |