diff --git a/client/modules/IDE/components/Toolbar.unit.test.jsx b/client/modules/IDE/components/Toolbar.unit.test.jsx index c02816f238..0b9ffdf1a4 100644 --- a/client/modules/IDE/components/Toolbar.unit.test.jsx +++ b/client/modules/IDE/components/Toolbar.unit.test.jsx @@ -22,6 +22,7 @@ const renderComponent = (extraProps = {}) => { startSketch: jest.fn(), startAccessibleSketch: jest.fn(), saveProject: jest.fn(), + syncFileContent: jest.fn(), currentUser: 'me', originalProjectName: 'testname', @@ -90,4 +91,20 @@ describe('', () => { await waitFor(() => expect(props.setProjectName).not.toHaveBeenCalled()); await waitFor(() => expect(props.saveProject).not.toHaveBeenCalled()); }); + + it('sketch is started when play button is clicked', async () => { + const props = renderComponent(); + const playButton = screen.getByLabelText('Play only visual sketch'); + fireEvent.click(playButton); + + await waitFor(() => expect(props.startSketch).toHaveBeenCalled()); + }); + + it('sketch content is synched when play button is clicked', async () => { + const props = renderComponent(); + const playButton = screen.getByLabelText('Play only visual sketch'); + fireEvent.click(playButton); + + await waitFor(() => expect(props.syncFileContent).toHaveBeenCalled()); + }); });