From 1ad8a99887fa08feb85b0344f5bc5c9bbd3c7ca2 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Mon, 12 Dec 2022 12:54:15 +0000 Subject: [PATCH] Merge pull request #10858 from overleaf/ae-source-editor-tests Refactor source editor Cypress tests into smaller files GitOrigin-RevId: fb80e7ddf3553f384c06c279404e16375dadaa44 --- services/web/cypress/support/shared/commands/index.ts | 3 +++ services/web/cypress/support/shared/commands/spelling.ts | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 services/web/cypress/support/shared/commands/spelling.ts diff --git a/services/web/cypress/support/shared/commands/index.ts b/services/web/cypress/support/shared/commands/index.ts index f1f4b64497..2bd102b220 100644 --- a/services/web/cypress/support/shared/commands/index.ts +++ b/services/web/cypress/support/shared/commands/index.ts @@ -1,6 +1,7 @@ import '@testing-library/cypress/add-commands' import { interceptCompile } from './compile' import { interceptEvents } from './events' +import { interceptSpelling } from './spelling' // eslint-disable-next-line no-unused-vars,@typescript-eslint/no-namespace declare global { @@ -10,9 +11,11 @@ declare global { interface Chainable { interceptCompile: typeof interceptCompile interceptEvents: typeof interceptEvents + interceptSpelling: typeof interceptSpelling } } } Cypress.Commands.add('interceptCompile', interceptCompile) Cypress.Commands.add('interceptEvents', interceptEvents) +Cypress.Commands.add('interceptSpelling', interceptSpelling) diff --git a/services/web/cypress/support/shared/commands/spelling.ts b/services/web/cypress/support/shared/commands/spelling.ts new file mode 100644 index 0000000000..3a50d1b7f9 --- /dev/null +++ b/services/web/cypress/support/shared/commands/spelling.ts @@ -0,0 +1,3 @@ +export const interceptSpelling = () => { + cy.intercept('POST', '/spelling/check', []) +}