From bac35566ff3d4afcf539756a852716defe6c361c Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 10 Jul 2024 12:23:09 +0100 Subject: [PATCH] Add Cypress component tests for AI error assistant (#19256) GitOrigin-RevId: 42e9e69317c97263cdcb55372e4a2cb41bccf516 --- services/web/cypress/support/shared/commands/events.ts | 2 +- services/web/cypress/support/shared/commands/index.ts | 3 +++ services/web/cypress/support/shared/commands/tutorials.ts | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 services/web/cypress/support/shared/commands/tutorials.ts diff --git a/services/web/cypress/support/shared/commands/events.ts b/services/web/cypress/support/shared/commands/events.ts index 49b7879bd8..26a6375c06 100644 --- a/services/web/cypress/support/shared/commands/events.ts +++ b/services/web/cypress/support/shared/commands/events.ts @@ -1,5 +1,5 @@ export const interceptEvents = () => { cy.intercept('POST', '/event/*', { statusCode: 204, - }) + }).as('createEvent') } diff --git a/services/web/cypress/support/shared/commands/index.ts b/services/web/cypress/support/shared/commands/index.ts index 7d12eb1bbb..1a7989c380 100644 --- a/services/web/cypress/support/shared/commands/index.ts +++ b/services/web/cypress/support/shared/commands/index.ts @@ -12,6 +12,7 @@ import { interceptProjectListing } from './project-list' import { interceptLinkedFile } from './linked-file' import { interceptMathJax } from './mathjax' import { interceptMetadata } from './metadata' +import { interceptTutorials } from './tutorials' // eslint-disable-next-line no-unused-vars,@typescript-eslint/no-namespace declare global { @@ -30,6 +31,7 @@ declare global { interceptProjectListing: typeof interceptProjectListing interceptLinkedFile: typeof interceptLinkedFile interceptMathJax: typeof interceptMathJax + interceptTutorials: typeof interceptTutorials } } } @@ -45,3 +47,4 @@ Cypress.Commands.add('interceptFileUpload', interceptFileUpload) Cypress.Commands.add('interceptProjectListing', interceptProjectListing) Cypress.Commands.add('interceptLinkedFile', interceptLinkedFile) Cypress.Commands.add('interceptMathJax', interceptMathJax) +Cypress.Commands.add('interceptTutorials', interceptTutorials) diff --git a/services/web/cypress/support/shared/commands/tutorials.ts b/services/web/cypress/support/shared/commands/tutorials.ts new file mode 100644 index 0000000000..900db6e589 --- /dev/null +++ b/services/web/cypress/support/shared/commands/tutorials.ts @@ -0,0 +1,5 @@ +export const interceptTutorials = () => { + cy.intercept('POST', '/tutorial/**', { + statusCode: 204, + }).as('completeTutorial') +}