Skip to content

Commit e6886b4

Browse files
committed
simplify helper function
1 parent d9257c1 commit e6886b4

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

packages/app/cypress/e2e/runs.cy.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,16 @@ import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json'
22
import type { SinonStub } from 'sinon'
33

44
function scaffoldTestingTypeAndVisitRunsPage (testingType: 'e2e' | 'component') {
5-
if (testingType === 'component') {
6-
cy.scaffoldProject('component-tests')
7-
cy.openProject('component-tests')
8-
cy.startAppServer('component')
9-
} else {
10-
cy.scaffoldProject('e2e-with-project-id')
11-
cy.openProject('e2e-with-project-id')
12-
cy.startAppServer('e2e')
13-
}
5+
cy.scaffoldProject('cypress-in-cypress')
6+
cy.openProject('cypress-in-cypress')
7+
cy.startAppServer(testingType)
148

159
cy.loginUser()
10+
11+
// make sure there are no runs found for the project ID
1612
cy.remoteGraphQLIntercept(async (obj) => {
17-
if (obj.result.data?.cloudProjectsBySlugs) {
18-
for (const proj of obj.result.data.cloudProjectsBySlugs) {
19-
if (proj.runs?.nodes) {
20-
proj.runs.nodes = []
21-
}
22-
}
13+
if (obj.result.data?.cloudProjectBySlug) {
14+
obj.result.data.cloudProjectBySlug.runs.nodes = []
2315
}
2416

2517
return obj.result

system-tests/projects/e2e-with-project-id/cypress.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

system-tests/projects/e2e-with-project-id/cypress/e2e/passing.cy.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)