@@ -28,7 +28,7 @@ describe('Playground tests', () => {
2828 test ( 'Running js-slang by clicking the run button' , async ( ) => {
2929 const component = render ( < Playground /> ) ;
3030 await clickRunButton ( component ) ;
31- expect ( runInContext ) . toHaveBeenCalled ( ) ;
31+ await expect . poll ( ( ) => runInContext ) . toHaveBeenCalled ( ) ;
3232 } ) ;
3333
3434 test ( 'Loading tabs via Vite' , async ( ) => {
@@ -37,7 +37,7 @@ describe('Playground tests', () => {
3737 const component = render ( < Playground /> ) ;
3838
3939 await clickRunButton ( component ) ;
40- expect ( runInContext ) . toHaveBeenCalled ( ) ;
40+ await expect . poll ( ( ) => runInContext ) . toHaveBeenCalled ( ) ;
4141 expect ( importers . getDynamicTabs ) . toHaveBeenCalled ( ) ;
4242 } ) ;
4343
@@ -54,26 +54,7 @@ describe('Playground tests', () => {
5454 await userEvent . click ( settingsButton ) ;
5555
5656 await clickRunButton ( component ) ;
57- expect ( runInContext ) . toHaveBeenCalled ( ) ;
57+ await expect . poll ( ( ) => runInContext ) . toHaveBeenCalled ( ) ;
5858 expect ( importers . getCompiledTabs ) . toHaveBeenCalled ( ) ;
5959 } ) ;
60-
61- test ( 'Multiple evaluations' , async ( ) => {
62- const component = render ( < Playground /> ) ;
63-
64- await commands . setLocalStorage ( 'editorValue' , 'delete this' ) ;
65- await clickRunButton ( component ) ;
66-
67- const crossIcon = component . baseElement . getElementsByClassName ( 'bp5-icon bp5-icon-cross' ) . item ( 0 ) ;
68- console . log ( crossIcon ) ;
69- await userEvent . click ( crossIcon ! ) ;
70-
71- const replCard = component . baseElement . getElementsByTagName ( 'pre' ) ;
72- console . log ( replCard ) ;
73-
74- await commands . setLocalStorage ( 'editorValue' , '0;' ) ;
75- await clickRunButton ( component ) ;
76-
77- expect ( runInContext ) . toHaveBeenCalledTimes ( 2 ) ;
78- } ) ;
7960} ) ;
0 commit comments