@@ -99,4 +99,43 @@ describe('Show graph only mode', function () {
9999 cy . toolbar ( ) . should ( 'exist' ) ;
100100 cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
101101 } ) ;
102+
103+ it ( 'Shows the graph only when the \'f\' key is pressed after a previous fullscreen has been disabled by clicking the open in full button' , function ( ) {
104+ cy . startCleanApplication ( ) ;
105+ cy . clearAndRenderDotSource ( 'digraph {Alice -> Bob}' ) ;
106+
107+ cy . node ( 1 ) . should ( 'exist' ) ;
108+ cy . node ( 2 ) . should ( 'exist' ) ;
109+ cy . edge ( 1 ) . should ( 'exist' ) ;
110+
111+ cy . node ( 1 ) . shouldHaveName ( 'Alice' ) ;
112+ cy . node ( 2 ) . shouldHaveName ( 'Bob' ) ;
113+ cy . edge ( 1 ) . shouldHaveName ( 'Alice->Bob' ) ;
114+
115+ cy . nodes ( ) . should ( 'have.length' , 2 ) ;
116+ cy . edges ( ) . should ( 'have.length' , 1 ) ;
117+
118+ cy . textEditorWrapper ( ) . should ( 'be.visible' ) ;
119+ cy . toolbar ( ) . should ( 'exist' ) ;
120+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
121+
122+ cy . canvas ( ) . click ( ) ;
123+ cy . get ( 'body' ) . type ( 'f' ) ;
124+
125+ cy . textEditorWrapper ( ) . should ( 'not.be.visible' ) ;
126+ cy . toolbar ( ) . should ( 'not.exist' ) ;
127+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.eq' , viewportWidth )
128+
129+ cy . fullscreenButton ( ) . click ( ) ;
130+
131+ cy . textEditorWrapper ( ) . should ( 'be.visible' ) ;
132+ cy . toolbar ( ) . should ( 'exist' ) ;
133+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
134+
135+ cy . get ( 'body' ) . type ( 'f' ) ;
136+
137+ cy . textEditorWrapper ( ) . should ( 'not.be.visible' ) ;
138+ cy . toolbar ( ) . should ( 'not.exist' ) ;
139+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.eq' , viewportWidth )
140+ } ) ;
102141} ) ;
0 commit comments