Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e_tests/integration/auto-prefix.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ describe(':auto prefix in browser', () => {
if (Cypress.config('serverVersion') >= 4.4) {
it('shows help link when running CALL IN TRANSACTIONS without :auto', () => {
cy.executeCommand(
`MATCH (n) WITH n CALL {{} CALL db.ping() YIELD SUCCESS {}} IN TRANSACTIONS`
`MATCH (n) WITH n CALL {{} CALL db.ping() YIELD success {}} IN TRANSACTIONS`
)
cy.getFrames().contains('ERROR')
cy.getFrames().contains(':auto')
})

it('adding :auto enables running CALL IN TRANSACTIONS', () => {
cy.executeCommand(
`:auto MATCH (n) WITH n CALL {{} CALL db.ping() YIELD SUCCESS {}} IN TRANSACTIONS`
`:auto MATCH (n) WITH n CALL {{} CALL db.ping() YIELD success {}} IN TRANSACTIONS`
)
cy.getFrames().should('not.contain', 'ERROR')
cy.getFrames().contains('(no changes, no records)')
Expand Down
56 changes: 27 additions & 29 deletions e2e_tests/integration/loadcsv.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,48 +30,46 @@ describe('LOAD CSV', () => {
cy.connect('neo4j', password)
})
it('imports without periodic commit', () => {
if (!Cypress.config('includeImportTests')) {
return
}
cy.executeCommand(':clear')
cy.executeCommand('MATCH (n) DETACH DELETE n')
cy.executeCommand(`LOAD CSV WITH HEADERS FROM 'file:///import.csv' AS row{shift}{enter}
if (Cypress.config('includeImportTests')) {
cy.executeCommand(':clear')
cy.executeCommand('MATCH (n) DETACH DELETE n')
cy.executeCommand(`LOAD CSV WITH HEADERS FROM 'file:///import.csv' AS row{shift}{enter}
CREATE (p:Person {{}name: row.name, born: toInteger(row.born), city: row.city, comment:row.comment});`)

cy.resultContains('Added 3 labels, created 3 nodes, set 11 properties,')
cy.resultContains('Added 3 labels, created 3 nodes, set 11 properties,')

cy.executeCommand(
'MATCH (n:Person {{}born: 2012}) RETURN n.city, n.comment'
)
cy.resultContains('"Borås"')
cy.resultContains('"I like unicorns, and "flying unicorns""')
cy.executeCommand(
'MATCH (n:Person {{}born: 2012}) RETURN n.city, n.comment'
)
cy.resultContains('"Borås"')
cy.resultContains('"I like unicorns, and "flying unicorns""')
}
})
it('imports with periodic commit', () => {
if (
!Cypress.config('includeImportTests') &&
Cypress.config('includeImportTests') &&
Cypress.config('serverVersion') < 5
) {
return
}
const periodicQuery = `USING PERIODIC COMMIT 1{shift}{enter}
const periodicQuery = `USING PERIODIC COMMIT 1{shift}{enter}
LOAD CSV WITH HEADERS FROM 'file:///import.csv' AS row
CREATE (p:Person {{}name: row.name, born: toInteger(row.born), city: row.city, comment:row.comment});`

// Let's see it fail when not using auto-committed tx's first
cy.executeCommand(':clear')
cy.executeCommand(periodicQuery)
cy.resultContains('Neo.ClientError.Statement.SemanticError')
// Let's see it fail when not using auto-committed tx's first
cy.executeCommand(':clear')
cy.executeCommand(periodicQuery)
cy.resultContains('Neo.ClientError.Statement.SemanticError')

cy.executeCommand(':clear')
cy.executeCommand('MATCH (n) DETACH DELETE n')
cy.executeCommand(`:auto ${periodicQuery}`)
cy.executeCommand(':clear')
cy.executeCommand('MATCH (n) DETACH DELETE n')
cy.executeCommand(`:auto ${periodicQuery}`)

cy.resultContains('Added 3 labels, created 3 nodes, set 11 properties,')
cy.resultContains('Added 3 labels, created 3 nodes, set 11 properties,')

cy.executeCommand(
'MATCH (n:Person {{}born: 2012}) RETURN n.city, n.comment'
)
cy.resultContains('"Borås"')
cy.resultContains('"I like unicorns, and "flying unicorns""')
cy.executeCommand(
'MATCH (n:Person {{}born: 2012}) RETURN n.city, n.comment'
)
cy.resultContains('"Borås"')
cy.resultContains('"I like unicorns, and "flying unicorns""')
}
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { fireEvent, render } from '@testing-library/react'
import React from 'react'
import { createBus } from 'suber'

import { QueriesFrame } from './QueriesFrame'
import { LegacyQueriesFrame } from './LegacyQueriesFrame'
import {
CONNECTED_STATE,
DISCONNECTED_STATE
Expand All @@ -41,7 +41,7 @@ it('shows error message in statusBar when not connected', () => {
const props = {
connectionState: DISCONNECTED_STATE
} as any
const { getByText } = render(<QueriesFrame {...props} />)
const { getByText } = render(<LegacyQueriesFrame {...props} />)

expect(getByText(/Unable to connect to bolt server/i)).not.toBeNull()
})
Expand Down Expand Up @@ -82,10 +82,12 @@ it('can list and kill queries', () => {
isFullscreen: false,
isCollapsed: false,
isOnCausalCluster: false,
canListQueries: true
hasListQueriesProcedure: true,
versionOverFive: false,
frame: null
}

const { getByText, getByTestId } = render(<QueriesFrame {...props} />)
const { getByText, getByTestId } = render(<LegacyQueriesFrame {...props} />)

// Check that it's listed
expect(getByText('neo4j://testhost.test')).not.toBeNull()
Expand Down
Loading