@@ -926,6 +926,43 @@ define(function (require, exports, module) {
926926 await endPreviewSession ( ) ;
927927 } , 30000 ) ;
928928
929+ it ( "should hide play button and mode dropdown when previewing markdown file" , async function ( ) {
930+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) ,
931+ "SpecRunnerUtils.openProjectFiles simple1.html" ) ;
932+
933+ await waitsForLiveDevelopmentToOpen ( ) ;
934+
935+ // Play button and mode dropdown should be visible for HTML files
936+ let $previewBtn = testWindow . $ ( "#previewModeLivePreviewButton" ) ;
937+ let $modeBtn = testWindow . $ ( "#livePreviewModeBtn" ) ;
938+ expect ( $previewBtn . is ( ":visible" ) ) . toBeTrue ( ) ;
939+ expect ( $modeBtn . is ( ":visible" ) ) . toBeTrue ( ) ;
940+
941+ // Open a markdown file
942+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "readme.md" ] ) ,
943+ "readme.md" ) ;
944+ await awaits ( 300 ) ;
945+
946+ // Play button and mode dropdown should be hidden for markdown files
947+ await awaitsFor ( ( ) => {
948+ return ! testWindow . $ ( "#previewModeLivePreviewButton" ) . is ( ":visible" ) &&
949+ ! testWindow . $ ( "#livePreviewModeBtn" ) . is ( ":visible" ) ;
950+ } , "play button and mode dropdown to be hidden" ) ;
951+
952+ // Switch back to HTML file
953+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) ,
954+ "simple1.html" ) ;
955+ await awaits ( 300 ) ;
956+
957+ // Play button and mode dropdown should be visible again
958+ await awaitsFor ( ( ) => {
959+ return testWindow . $ ( "#previewModeLivePreviewButton" ) . is ( ":visible" ) &&
960+ testWindow . $ ( "#livePreviewModeBtn" ) . is ( ":visible" ) ;
961+ } , "play button and mode dropdown to be visible again" ) ;
962+
963+ await endPreviewSession ( ) ;
964+ } , 30000 ) ;
965+
929966 it ( "should not live preview binary image files" , async function ( ) {
930967 await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) ,
931968 "SpecRunnerUtils.openProjectFiles simple1.html" ) ;
0 commit comments