Skip to content

Commit 243faba

Browse files
committed
Fix integration tests related to index and contraint create/drop
The syntax for creating and droping constraint in Neo4j 5.0 changed. `ON` keyword was replace by `FOR` and `ASSERT` replaced by `REQUIRED`.
1 parent e38d125 commit 243faba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/neo4j-driver/test/rx/summary.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ describe('#integration-rx summary', () => {
436436
return
437437
}
438438

439-
await verifyUpdates(runnable, 'CREATE INDEX on :Label(prop)', null, {
439+
await verifyUpdates(runnable, 'CREATE INDEX FOR :Label(prop)', null, {
440440
nodesCreated: 0,
441441
nodesDeleted: 0,
442442
relationshipsCreated: 0,
@@ -467,12 +467,12 @@ describe('#integration-rx summary', () => {
467467
// first create the to-be-dropped index
468468
const session = driver.session()
469469
try {
470-
await session.run('CREATE INDEX on :Label(prop)')
470+
await session.run('CREATE INDEX FOR :Label(prop)')
471471
} finally {
472472
await session.close()
473473
}
474474

475-
await verifyUpdates(runnable, 'DROP INDEX on :Label(prop)', null, {
475+
await verifyUpdates(runnable, 'DROP INDEX FOR :Label(prop)', null, {
476476
nodesCreated: 0,
477477
nodesDeleted: 0,
478478
relationshipsCreated: 0,
@@ -501,7 +501,7 @@ describe('#integration-rx summary', () => {
501501

502502
await verifyUpdates(
503503
runnable,
504-
'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE',
504+
'CREATE CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE',
505505
null,
506506
{
507507
nodesCreated: 0,
@@ -536,15 +536,15 @@ describe('#integration-rx summary', () => {
536536
const session = driver.session()
537537
try {
538538
await session.run(
539-
'CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE'
539+
'CREATE CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE'
540540
)
541541
} finally {
542542
await session.close()
543543
}
544544

545545
await verifyUpdates(
546546
runnable,
547-
'DROP CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE',
547+
'DROP CONSTRAINT FOR (book:Book) REQUIRE book.isbn IS UNIQUE',
548548
null,
549549
{
550550
nodesCreated: 0,

0 commit comments

Comments
 (0)