Skip to content

Commit ae255b1

Browse files
committed
Merge develop to update/add-test-for-stop-button
2 parents c539651 + 481f80e commit ae255b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const renderComponent = (extraProps = {}) => {
2222
startSketch: jest.fn(),
2323
startAccessibleSketch: jest.fn(),
2424
saveProject: jest.fn(),
25+
syncFileContent: jest.fn(),
2526
currentUser: 'me',
2627
originalProjectName: 'testname',
2728

@@ -100,4 +101,20 @@ describe('<ToolbarComponent />', () => {
100101

101102
await waitFor(() => expect(props.stopSketch).toHaveBeenCalled());
102103
});
104+
105+
it('sketch is started when play button is clicked', async () => {
106+
const props = renderComponent();
107+
const playButton = screen.getByLabelText('Play only visual sketch');
108+
fireEvent.click(playButton);
109+
110+
await waitFor(() => expect(props.startSketch).toHaveBeenCalled());
111+
});
112+
113+
it('sketch content is synched when play button is clicked', async () => {
114+
const props = renderComponent();
115+
const playButton = screen.getByLabelText('Play only visual sketch');
116+
fireEvent.click(playButton);
117+
118+
await waitFor(() => expect(props.syncFileContent).toHaveBeenCalled());
119+
});
103120
});

0 commit comments

Comments
 (0)