@@ -645,6 +645,39 @@ define(function (require, exports, module) {
645645 await endPreviewSession ( ) ;
646646 } , 30000 ) ;
647647
648+ it ( "should custom server show banner on first show only" , async function ( ) {
649+ await _setupSimpleProject ( "sub/" , false ) ;
650+
651+ // should still show markdown previews with internal live preview server!
652+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "readme.md" ] ) ,
653+ "open sub.html" ) ;
654+ await _waitForIframeMDFile ( 'readme.md' ) ;
655+ expect ( testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ) . toBe ( false ) ;
656+
657+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "sub/sub.html" ] ) ,
658+ "open sub.html" ) ;
659+
660+ await awaitsFor ( ( ) => {
661+ return testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ;
662+ } , "banner to show" ) ;
663+
664+ testWindow . $ ( ".custom-server-banner-close-icon" ) . click ( ) ;
665+ expect ( testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ) . toBe ( false ) ;
666+
667+ // now switch to readme file
668+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "readme.md" ] ) ,
669+ "open sub.html" ) ;
670+ await _waitForIframeMDFile ( 'readme.md' ) ;
671+
672+ // switch to html file
673+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "sub/sub.html" ] ) ,
674+ "open sub.html" ) ;
675+ await _waitForIframeURL ( 'http://localhost:43768/sub.html' ) ;
676+ expect ( testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ) . toBe ( false ) ;
677+
678+ await endPreviewSession ( ) ;
679+ } , 30000 ) ;
680+
648681 async function _forSVGLivePreview ( ) {
649682 await awaitsFor ( ( ) => {
650683 let iFrame = testWindow . document . getElementById ( "panel-live-preview-frame" ) ;
0 commit comments