1
1
describe ( 'Tabs' , ( ) => {
2
2
it ( 'Should store editor contents when switching between tabs' , ( ) => {
3
- cy . visit ( '/ ?defaultQuery=&query =' ) ;
3
+ cy . visit ( '?defaultQuery=' ) ;
4
4
5
5
// Assert that tab visible when there's only one session
6
6
cy . get ( '.graphiql-tab-button' ) . eq ( 0 ) . should ( 'exist' ) ;
7
-
8
7
// Enter a query without operation name
9
8
cy . get ( '.graphiql-query-editor textarea' ) . type ( '{id' , { force : true } ) ;
10
9
11
10
// Run the query
12
11
cy . clickExecuteQuery ( ) ;
12
+ // Assert request is not cancelled
13
+ cy . get ( '.result-window' ) . should ( 'not.have.text' , '' ) ;
13
14
14
15
// Open a new tab
15
16
cy . get ( '.graphiql-tab-add' ) . click ( ) ;
@@ -33,7 +34,8 @@ describe('Tabs', () => {
33
34
34
35
// Run the query
35
36
cy . clickExecuteQuery ( ) ;
36
-
37
+ // Assert request is not cancelled
38
+ cy . get ( '.result-window' ) . should ( 'not.have.text' , '' ) ;
37
39
// Switch back to the first tab
38
40
cy . get ( '.graphiql-tab-button' ) . eq ( 0 ) . click ( ) ;
39
41
@@ -82,7 +84,7 @@ describe('Tabs', () => {
82
84
describe ( 'confirmCloseTab()' , ( ) => {
83
85
it ( 'should keep tab when `Cancel` was clicked' , ( ) => {
84
86
cy . on ( 'window:confirm' , ( ) => false ) ;
85
- cy . visit ( '/ ?confirmCloseTab=true' ) ;
87
+ cy . visit ( '?confirmCloseTab=true' ) ;
86
88
87
89
cy . get ( '.graphiql-tab-add' ) . click ( ) ;
88
90
@@ -93,7 +95,7 @@ describe('Tabs', () => {
93
95
94
96
it ( 'should close tab when `OK` was clicked' , ( ) => {
95
97
cy . on ( 'window:confirm' , ( ) => true ) ;
96
- cy . visit ( '/ ?confirmCloseTab=true' ) ;
98
+ cy . visit ( '?confirmCloseTab=true' ) ;
97
99
98
100
cy . get ( '.graphiql-tab-add' ) . click ( ) ;
99
101
0 commit comments