From 4e861542de03d9ee126c4741652227397bb7f650 Mon Sep 17 00:00:00 2001 From: Paul Kaplan <pkaplan@media.mit.edu> Date: Wed, 20 Dec 2017 11:10:17 -0500 Subject: [PATCH] Update tests and snapshots for sound editor --- .../__snapshots__/sound-editor.test.jsx.snap | 74 ++++++++++--------- test/unit/components/sound-editor.test.jsx | 4 +- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/test/unit/components/__snapshots__/sound-editor.test.jsx.snap b/test/unit/components/__snapshots__/sound-editor.test.jsx.snap index ac545dd6e..cb1dea108 100644 --- a/test/unit/components/__snapshots__/sound-editor.test.jsx.snap +++ b/test/unit/components/__snapshots__/sound-editor.test.jsx.snap @@ -7,19 +7,6 @@ exports[`Sound Editor Component matches snapshot 1`] = ` <div className={undefined} > - <div - className={undefined} - > - <button - className="" - onClick={[Function]} - title="Stop" - > - <img - src="test-file-stub" - /> - </button> - </div> <div className={undefined} > @@ -42,22 +29,6 @@ exports[`Sound Editor Component matches snapshot 1`] = ` value="sound name" /> </label> - </div> - <div - className={undefined} - > - <button - className="undefined" - onClick={[Function]} - title="Save" - > - <img - src="test-file-stub" - /> - <span> - Save - </span> - </button> <div className={undefined} > @@ -83,6 +54,23 @@ exports[`Sound Editor Component matches snapshot 1`] = ` </button> </div> </div> + <div + className="undefined" + onClick={[Function]} + role="button" + > + <img + className={undefined} + src="test-file-stub" + /> + <div + className={undefined} + > + <span> + Save + </span> + </div> + </div> </div> <div className={undefined} @@ -92,16 +80,23 @@ exports[`Sound Editor Component matches snapshot 1`] = ` > <svg className={undefined} - viewBox="0 0 600 180" + viewBox="-1 0 600 160" > + <line + className={undefined} + x1={-1} + x2={600} + y1={80} + y2={80} + /> <g - transform="scale(1, -1) translate(0, -90)" + transform="scale(1, -1) translate(0, -80)" > <path className={undefined} - d="M0 0Q0 0 60 45 Q120 90 180 135 Q240 180 300 225 Q360 270 420 135 Q480 0 480 0 Q480 0 420 -135 Q360 -270 300 -225 Q240 -180 180 -135 Q120 -90 60 -45 Q0 0 0 0Z" + d="M0 0Q0 0 60 40 Q120 80 180 120 Q240 160 300 200 Q360 240 420 120 Q480 0 480 0 Q480 0 420 -120 Q360 -240 300 -200 Q240 -160 180 -120 Q120 -80 60 -40 Q0 0 0 0Z" strokeLinejoin="round" - strokeWidth={2} + strokeWidth={1} /> </g> </svg> @@ -338,6 +333,19 @@ exports[`Sound Editor Component matches snapshot 1`] = ` <div className={undefined} > + <div + className={undefined} + > + <button + className="" + onClick={[Function]} + title="Stop" + > + <img + src="test-file-stub" + /> + </button> + </div> <div className="" onClick={[Function]} diff --git a/test/unit/components/sound-editor.test.jsx b/test/unit/components/sound-editor.test.jsx index 387a53c1a..efb153b1f 100644 --- a/test/unit/components/sound-editor.test.jsx +++ b/test/unit/components/sound-editor.test.jsx @@ -44,7 +44,7 @@ describe('Sound Editor Component', () => { trimStart={null} /> ); - wrapper.find('button[title="Trim"]').simulate('click'); + wrapper.find('[children="Trim"]').simulate('click'); expect(props.onActivateTrim).toHaveBeenCalled(); }); @@ -56,7 +56,7 @@ describe('Sound Editor Component', () => { trimStart={0.25} /> ); - wrapper.find('button[title="Save"]').simulate('click'); + wrapper.find('[children="Save"]').simulate('click'); expect(props.onActivateTrim).toHaveBeenCalled(); }); -- GitLab