diff --git a/src/shared/modules/commands/cypher.test.ts b/src/shared/modules/commands/cypher.test.ts index 90bb0d3568f..b032dff8aeb 100644 --- a/src/shared/modules/commands/cypher.test.ts +++ b/src/shared/modules/commands/cypher.test.ts @@ -57,6 +57,14 @@ jest.mock('shared/modules/dbMeta/dbMetaDuck', () => { } }) +jest.mock('shared/modules/settings/settingsDuck', () => { + const orig = require.requireActual('shared/modules/dbMeta/dbMetaDuck') + return { + ...orig, + shouldUseReadTransactions: () => false + } +}) + describe('tx metadata with cypher', () => { afterEach(() => { bolt.routedWriteTransaction.mockClear() @@ -153,10 +161,11 @@ multiline comment action.$$responseChannel = $$responseChannel bus.send(action.type, action) - flushPromises().then(() => { - expect(bolt.routedWriteTransaction).toHaveBeenCalledTimes(1) - expect(bolt.routedWriteTransaction).toHaveBeenCalledWith( - `// comment + flushPromises() + .then(() => { + expect(bolt.routedWriteTransaction).toHaveBeenCalledTimes(1) + expect(bolt.routedWriteTransaction).toHaveBeenCalledWith( + `// comment /* multiline comment */ @@ -164,13 +173,14 @@ multiline comment // comment /*:auto*/ RETURN ":auto"`, - {}, - expect.objectContaining({ - autoCommit: true - }) - ) - done() - }) + {}, + expect.objectContaining({ + autoCommit: true + }) + ) + done() + }) + .catch(e => console.error(e)) }) test('it sends the autoCommit flag = false to tx functions on regular cypher', done => { // Given diff --git a/src/shared/modules/commands/use-db-ww.test.ts b/src/shared/modules/commands/use-db-ww.test.ts index c64b4ce9ed9..95b80e10114 100644 --- a/src/shared/modules/commands/use-db-ww.test.ts +++ b/src/shared/modules/commands/use-db-ww.test.ts @@ -41,6 +41,14 @@ jest.mock('shared/modules/params/paramsDuck', () => { } }) +jest.mock('shared/modules/settings/settingsDuck', () => { + const orig = require.requireActual('shared/modules/dbMeta/dbMetaDuck') + return { + ...orig, + shouldUseReadTransactions: () => false + } +}) + jest.mock('shared/modules/dbMeta/dbMetaDuck', () => { const orig = jest.requireActual('shared/modules/dbMeta/dbMetaDuck') return { diff --git a/src/shared/modules/settings/__snapshots__/settingsDuck.test.ts.snap b/src/shared/modules/settings/__snapshots__/settingsDuck.test.ts.snap index 88cdc1c45db..611bb7e1947 100644 --- a/src/shared/modules/settings/__snapshots__/settingsDuck.test.ts.snap +++ b/src/shared/modules/settings/__snapshots__/settingsDuck.test.ts.snap @@ -25,5 +25,6 @@ Object { "showWheelZoomInfo": true, "theme": "auto", "useBoltRouting": false, + "useReadTransactions": false, } `;