@@ -12,13 +12,13 @@ import {
1212
1313//** Checks that the query result for each statement containts the expected summaries in query details.
1414// If we pass an expected summary that is undefined we expect an empty result from query execution */
15- export async function expectSummaries (
16- expectedSummaries : ( string | undefined ) [ ] ,
15+ export async function expectSummariesContain (
16+ expectedSubstrings : ( string | undefined ) [ ] ,
1717) {
1818 const queryDetails = await $$ ( '#queryDetails .collapsible' ) ;
19- await expect ( queryDetails . length ) . toBe ( expectedSummaries . length ) ;
19+ await expect ( queryDetails . length ) . toBe ( expectedSubstrings . length ) ;
2020
21- for ( let i = 0 ; i < expectedSummaries . length ; i ++ ) {
21+ for ( let i = 0 ; i < expectedSubstrings . length ; i ++ ) {
2222 const queryDetail = ( await $$ ( '#queryDetails .collapsible' ) ) [ i ] ;
2323 //This matches the expand/collapse button, but we only want to click when collapsed
2424 const expandButton = await queryDetail . $ ( 'button[aria-label*="statement"]' ) ;
@@ -30,8 +30,8 @@ export async function expectSummaries(
3030 const queryResult = await queryDetail . $ ( '.collapsible-content' ) ;
3131 await queryResult . waitForDisplayed ( ) ;
3232 const summary = await queryResult . getText ( ) ;
33- if ( expectedSummaries [ i ] !== undefined ) {
34- await expect ( summary ) . toContain ( expectedSummaries [ i ] ) ;
33+ if ( expectedSubstrings [ i ] !== undefined ) {
34+ await expect ( summary ) . toContain ( expectedSubstrings [ i ] ) ;
3535 } else {
3636 await expect ( summary ) . toBe ( '' ) ;
3737 }
@@ -50,7 +50,7 @@ suite('Query results testing', () => {
5050 test ( 'should manage queries that need implicit transactions' , async function ( ) {
5151 await executeFile ( workbench , 'call-in-transactions.cypher' ) ;
5252 await checkResultsContent ( workbench , true , async ( ) => {
53- await expectSummaries ( [
53+ await expectSummariesContain ( [
5454 '6 nodes created, 12 properties set, 6 labels added.' ,
5555 ] ) ;
5656 } ) ;
@@ -59,14 +59,14 @@ suite('Query results testing', () => {
5959 test ( 'should correctly execute valid Cypher' , async function ( ) {
6060 await executeFile ( workbench , 'valid.cypher' ) ;
6161 await checkResultsContent ( workbench , true , async ( ) => {
62- await expectSummaries ( [ '1 nodes created, 1 labels added.' ] ) ;
62+ await expectSummariesContain ( [ '1 nodes created, 1 labels added.' ] ) ;
6363 } ) ;
6464 } ) ;
6565
6666 test ( 'should correctly execute valid Cypher when highlighting several statements' , async function ( ) {
6767 await executeFile ( workbench , 'multiline.cypher' ) ;
6868 await checkResultsContent ( workbench , true , async ( ) => {
69- await expectSummaries ( [
69+ await expectSummariesContain ( [
7070 '1 nodes created, 1 labels added.' ,
7171 '2 nodes created, 2 labels added.' ,
7272 '' ,
@@ -77,7 +77,7 @@ suite('Query results testing', () => {
7777 test ( 'should error on invalid cypher' , async function ( ) {
7878 await executeFile ( workbench , 'invalid.cypher' ) ;
7979 await checkResultsContent ( workbench , true , async ( ) => {
80- await expectSummaries ( [ 'Variable `n` not defined' ] ) ;
80+ await expectSummariesContain ( [ 'Variable `n` not defined' ] ) ;
8181 } ) ;
8282 } ) ;
8383
@@ -91,11 +91,11 @@ suite('Query results testing', () => {
9191
9292 await executeFile ( workbench , 'create-for-match.cypher' ) ;
9393 await checkResultsContent ( workbench , true , async ( ) => {
94- await expectSummaries ( [ '1 nodes created, 1 labels added.' ] ) ;
94+ await expectSummariesContain ( [ '1 nodes created, 1 labels added.' ] ) ;
9595 } ) ;
9696 await executeFile ( workbench , 'match-for-create.cypher' ) ;
9797 await checkResultsContent ( workbench , true , async ( ) => {
98- await expectSummaries ( [ 'Started streaming 1 record' ] ) ;
98+ await expectSummariesContain ( [ 'Started streaming 1 record' ] ) ;
9999 } ) ;
100100
101101 // Disconnect from the current instance
@@ -105,7 +105,7 @@ suite('Query results testing', () => {
105105
106106 await executeFile ( workbench , 'match-for-create.cypher' ) ;
107107 await checkResultsContent ( workbench , true , async ( ) => {
108- await expectSummaries ( [ undefined ] ) ;
108+ await expectSummariesContain ( [ undefined ] ) ;
109109 } ) ;
110110 await clickOnContextMenuItem ( connectionSection , 'Disconnect' , 0 ) ;
111111
0 commit comments