@@ -14,6 +14,7 @@ type Op = {
1414 query : string ;
1515 variables ?: Record < string , any > ;
1616 variablesString ?: string ;
17+ extensionsString ?: string ;
1718 headersString ?: string ;
1819 response ?: Record < string , any > ;
1920} ;
@@ -73,7 +74,7 @@ Cypress.Commands.add('visitWithOp', ({ query, variables, variablesString }) => {
7374
7475Cypress . Commands . add (
7576 'assertHasValues' ,
76- ( { query, variables, variablesString, headersString, response } : Op ) => {
77+ ( { query, variables, variablesString, extensionsString , headersString, response } : Op ) => {
7778 cy . get ( '.graphiql-query-editor' ) . should ( element => {
7879 expect ( normalize ( element . get ( 0 ) . innerText ) ) . to . equal (
7980 codeWithLineNumbers ( query ) ,
@@ -100,14 +101,24 @@ Cypress.Commands.add(
100101 } ) ;
101102 }
102103 if ( headersString !== undefined ) {
103- cy . contains ( 'Headers' ) . click ( ) ;
104- cy . get ( '.graphiql-editor-tool .graphiql-editor' )
105- . eq ( 1 )
106- . should ( element => {
107- expect ( normalize ( element . get ( 0 ) . innerText ) ) . to . equal (
108- codeWithLineNumbers ( headersString ) ,
109- ) ;
110- } ) ;
104+ cy . contains ( 'Headers' ) . click ( ) ;
105+ cy . get ( '.graphiql-editor-tool .graphiql-editor' )
106+ . eq ( 1 )
107+ . should ( element => {
108+ expect ( normalize ( element . get ( 0 ) . innerText ) ) . to . equal (
109+ codeWithLineNumbers ( headersString ) ,
110+ ) ;
111+ } ) ;
112+ }
113+ if ( extensionsString !== undefined ) {
114+ cy . contains ( 'Extensions' ) . click ( ) ;
115+ cy . get ( '.graphiql-editor-tool .graphiql-editor' )
116+ . eq ( 2 )
117+ . should ( element => {
118+ expect ( normalize ( element . get ( 0 ) . innerText ) ) . to . equal (
119+ codeWithLineNumbers ( extensionsString ) ,
120+ ) ;
121+ } ) ;
111122 }
112123 if ( response !== undefined ) {
113124 cy . get ( '.result-window' ) . should ( element => {
0 commit comments