File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
client/modules/IDE/components Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const renderComponent = (extraProps = {}) => {
22
22
startSketch : jest . fn ( ) ,
23
23
startAccessibleSketch : jest . fn ( ) ,
24
24
saveProject : jest . fn ( ) ,
25
+ syncFileContent : jest . fn ( ) ,
25
26
currentUser : 'me' ,
26
27
originalProjectName : 'testname' ,
27
28
@@ -90,4 +91,20 @@ describe('<ToolbarComponent />', () => {
90
91
await waitFor ( ( ) => expect ( props . setProjectName ) . not . toHaveBeenCalled ( ) ) ;
91
92
await waitFor ( ( ) => expect ( props . saveProject ) . not . toHaveBeenCalled ( ) ) ;
92
93
} ) ;
94
+
95
+ it ( 'sketch is started when play button is clicked' , async ( ) => {
96
+ const props = renderComponent ( ) ;
97
+ const playButton = screen . getByLabelText ( 'Play only visual sketch' ) ;
98
+ fireEvent . click ( playButton ) ;
99
+
100
+ await waitFor ( ( ) => expect ( props . startSketch ) . toHaveBeenCalled ( ) ) ;
101
+ } ) ;
102
+
103
+ it ( 'sketch content is synched when play button is clicked' , async ( ) => {
104
+ const props = renderComponent ( ) ;
105
+ const playButton = screen . getByLabelText ( 'Play only visual sketch' ) ;
106
+ fireEvent . click ( playButton ) ;
107
+
108
+ await waitFor ( ( ) => expect ( props . syncFileContent ) . toHaveBeenCalled ( ) ) ;
109
+ } ) ;
93
110
} ) ;
You can’t perform that action at this time.
0 commit comments