From c11624ab06e0ea1f453db8c40d8669a9a1378b96 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum <eric.rosenbaum@gmail.com> Date: Tue, 9 Jul 2019 17:23:20 -0400 Subject: [PATCH] Fix tests and remove unused icons --- src/components/sound-editor/sound-editor.jsx | 2 - .../__snapshots__/sound-editor.test.jsx.snap | 58 +++++++++++++++++-- test/unit/components/sound-editor.test.jsx | 20 ++----- 3 files changed, 58 insertions(+), 22 deletions(-) diff --git a/src/components/sound-editor/sound-editor.jsx b/src/components/sound-editor/sound-editor.jsx index 8306229eb..316a0e2cb 100644 --- a/src/components/sound-editor/sound-editor.jsx +++ b/src/components/sound-editor/sound-editor.jsx @@ -15,8 +15,6 @@ import styles from './sound-editor.css'; import playIcon from '../record-modal/icon--play.svg'; import stopIcon from '../record-modal/icon--stop-playback.svg'; -import trimIcon from './icon--trim.svg'; -import trimConfirmIcon from './icon--trim-confirm.svg'; import redoIcon from './icon--redo.svg'; import undoIcon from './icon--undo.svg'; import echoIcon from './icon--echo.svg'; diff --git a/test/unit/components/__snapshots__/sound-editor.test.jsx.snap b/test/unit/components/__snapshots__/sound-editor.test.jsx.snap index e589ce5bc..950a25704 100644 --- a/test/unit/components/__snapshots__/sound-editor.test.jsx.snap +++ b/test/unit/components/__snapshots__/sound-editor.test.jsx.snap @@ -60,7 +60,59 @@ exports[`Sound Editor Component matches snapshot 1`] = ` </div> </div> <div - className="undefined" + className={undefined} + > + <div + className="" + onClick={undefined} + role="button" + > + <img + className={undefined} + draggable={false} + src="test-file-stub" + /> + <div + className={undefined} + > + Copy + </div> + </div> + <div + className="" + onClick={undefined} + role="button" + > + <img + className={undefined} + draggable={false} + src="test-file-stub" + /> + <div + className={undefined} + > + Paste + </div> + </div> + <div + className="" + onClick={undefined} + role="button" + > + <img + className={undefined} + draggable={false} + src="test-file-stub" + /> + <div + className={undefined} + > + Copy to New + </div> + </div> + </div> + <div + className="" onClick={[Function]} role="button" > @@ -72,9 +124,7 @@ exports[`Sound Editor Component matches snapshot 1`] = ` <div className={undefined} > - <span> - Save - </span> + Delete </div> </div> </div> diff --git a/test/unit/components/sound-editor.test.jsx b/test/unit/components/sound-editor.test.jsx index efb153b1f..7fd465241 100644 --- a/test/unit/components/sound-editor.test.jsx +++ b/test/unit/components/sound-editor.test.jsx @@ -13,8 +13,8 @@ describe('Sound Editor Component', () => { playhead: 0.5, trimStart: 0.2, trimEnd: 0.8, - onActivateTrim: jest.fn(), onChangeName: jest.fn(), + onDelete: jest.fn(), onPlay: jest.fn(), onRedo: jest.fn(), onReverse: jest.fn(), @@ -36,19 +36,7 @@ describe('Sound Editor Component', () => { expect(component.toJSON()).toMatchSnapshot(); }); - test('trim button appears when trims are null', () => { - const wrapper = mountWithIntl( - <SoundEditor - {...props} - trimEnd={null} - trimStart={null} - /> - ); - wrapper.find('[children="Trim"]').simulate('click'); - expect(props.onActivateTrim).toHaveBeenCalled(); - }); - - test('save button appears when trims are not null', () => { + test('delete button appears when selection is not null', () => { const wrapper = mountWithIntl( <SoundEditor {...props} @@ -56,8 +44,8 @@ describe('Sound Editor Component', () => { trimStart={0.25} /> ); - wrapper.find('[children="Save"]').simulate('click'); - expect(props.onActivateTrim).toHaveBeenCalled(); + wrapper.find('[children="Delete"]').simulate('click'); + expect(props.onDelete).toHaveBeenCalled(); }); test('play button appears when playhead is null', () => { -- GitLab