@@ -66,4 +66,76 @@ describe('Show graph only mode', function () {
6666 cy . toolbar ( ) . should ( 'exist' ) ;
6767 cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
6868 } ) ;
69+
70+ it ( 'Shows the graph only when the open in full button is clicked and shows the full application again when the \'f\' key is pressed' , function ( ) {
71+ cy . startCleanApplication ( ) ;
72+ cy . clearAndRenderDotSource ( 'digraph {Alice -> Bob}' ) ;
73+
74+ cy . node ( 1 ) . should ( 'exist' ) ;
75+ cy . node ( 2 ) . should ( 'exist' ) ;
76+ cy . edge ( 1 ) . should ( 'exist' ) ;
77+
78+ cy . node ( 1 ) . shouldHaveName ( 'Alice' ) ;
79+ cy . node ( 2 ) . shouldHaveName ( 'Bob' ) ;
80+ cy . edge ( 1 ) . shouldHaveName ( 'Alice->Bob' ) ;
81+
82+ cy . nodes ( ) . should ( 'have.length' , 2 ) ;
83+ cy . edges ( ) . should ( 'have.length' , 1 ) ;
84+
85+ cy . textEditorWrapper ( ) . should ( 'be.visible' ) ;
86+ cy . toolbar ( ) . should ( 'exist' ) ;
87+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
88+
89+ cy . canvas ( ) . click ( ) ;
90+ cy . fullscreenButton ( ) . click ( ) ;
91+
92+ cy . textEditorWrapper ( ) . should ( 'not.be.visible' ) ;
93+ cy . toolbar ( ) . should ( 'not.exist' ) ;
94+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.eq' , viewportWidth )
95+
96+ cy . get ( 'body' ) . type ( 'f' ) ;
97+
98+ cy . textEditorWrapper ( ) . should ( 'be.visible' ) ;
99+ cy . toolbar ( ) . should ( 'exist' ) ;
100+ cy . canvas ( ) . invoke ( 'width' ) . should ( 'be.lt' , viewportWidth / 2 )
101+ } ) ;
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+ } ) ;
69141} ) ;
0 commit comments