Skip to content

Commit 97b95c8

Browse files
committed
test that stopSketch is called when a sketch is playing and user clicks stop button
1 parent dd433b7 commit 97b95c8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

client/modules/IDE/components/Toolbar.test.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,14 @@ describe('<ToolbarComponent />', () => {
9090
await waitFor(() => expect(props.setProjectName).not.toHaveBeenCalled());
9191
await waitFor(() => expect(props.saveProject).not.toHaveBeenCalled());
9292
});
93+
94+
it('sketch is stopped when stop button is clicked', async () => {
95+
const props = renderComponent({ isPlaying: true });
96+
97+
const stopButton = screen.getByLabelText('Stop sketch');
98+
99+
fireEvent.click(stopButton);
100+
101+
await waitFor(() => expect(props.stopSketch).toHaveBeenCalled());
102+
});
93103
});

0 commit comments

Comments
 (0)