@@ -661,6 +661,11 @@ define(function (require, exports, module) {
661661 return testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ;
662662 } , "banner to show" ) ;
663663
664+ // now open the settings dialog
665+ testWindow . $ ( ".live-preview-settings-banner-btn" ) . click ( ) ;
666+ await SpecRunnerUtils . waitForModalDialog ( ) ;
667+ SpecRunnerUtils . clickDialogButton ( Dialogs . DIALOG_BTN_CANCEL ) ;
668+
664669 testWindow . $ ( ".custom-server-banner-close-icon" ) . click ( ) ;
665670 expect ( testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ) . toBe ( false ) ;
666671
@@ -669,7 +674,7 @@ define(function (require, exports, module) {
669674 "open sub.html" ) ;
670675 await _waitForIframeMDFile ( 'readme.md' ) ;
671676
672- // switch to html file
677+ // switch to html file, should not show banner after dismiss
673678 await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "sub/sub.html" ] ) ,
674679 "open sub.html" ) ;
675680 await _waitForIframeURL ( 'http://localhost:43768/sub.html' ) ;
@@ -678,6 +683,39 @@ define(function (require, exports, module) {
678683 await endPreviewSession ( ) ;
679684 } , 30000 ) ;
680685
686+ it ( "should custom server banner come back on changing live preview settings" , async function ( ) {
687+ await _setupSimpleProject ( "sub/" , false ) ;
688+
689+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "sub/sub.html" ] ) ,
690+ "open sub.html" ) ;
691+
692+ await awaitsFor ( ( ) => {
693+ return testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ;
694+ } , "banner to show" ) ;
695+
696+ testWindow . $ ( ".custom-server-banner-close-icon" ) . click ( ) ;
697+ expect ( testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ) . toBe ( false ) ;
698+
699+ // now change the server
700+ PreferencesManager . set ( PREFERENCE_PROJECT_SERVER_URL , "http://another.server:43768" ,
701+ PreferencesManager . PROJECT_SCOPE ) ;
702+
703+ // now switch to readme file
704+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "readme.md" ] ) ,
705+ "open sub.html" ) ;
706+ await _waitForIframeMDFile ( 'readme.md' ) ;
707+
708+ // switch to html file, should show banner again as server changed
709+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "sub/sub.html" ] ) ,
710+ "open sub.html" ) ;
711+
712+ await awaitsFor ( ( ) => {
713+ return testWindow . $ ( ".live-preview-custom-banner" ) . is ( ":visible" ) ;
714+ } , "banner to show" ) ;
715+
716+ await endPreviewSession ( ) ;
717+ } , 30000 ) ;
718+
681719 async function _forSVGLivePreview ( ) {
682720 await awaitsFor ( ( ) => {
683721 let iFrame = testWindow . document . getElementById ( "panel-live-preview-frame" ) ;
0 commit comments