From ffbe60a69765b571f13b88dcc7ce286c7506427f Mon Sep 17 00:00:00 2001 From: k3yi0 Date: Mon, 6 Jun 2022 09:40:53 +0200 Subject: [PATCH] chore(cypress): rename functions --- ui/cypress/index.d.ts | 8 +++---- ui/cypress/integration/dashboard.test.ts | 4 ++-- ui/cypress/support/commands.ts | 30 +++++++++++------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ui/cypress/index.d.ts b/ui/cypress/index.d.ts index 86ec0eff0..6bda4cbee 100644 --- a/ui/cypress/index.d.ts +++ b/ui/cypress/index.d.ts @@ -10,8 +10,8 @@ import { OAuthLogin, OAuthLogout, OAuthLoginAsDiffUser, - createUser, - deleteUser, + createChronografUser, + deleteChronografUser, createOrg, deleteOrg, createInfluxDBUser, @@ -34,8 +34,8 @@ declare global { OAuthLogin: typeof OAuthLogin OAuthLogout: typeof OAuthLogout OAuthLoginAsDiffUser: typeof OAuthLoginAsDiffUser - createUser: typeof createUser - deleteUser: typeof deleteUser + createChronografUser: typeof createChronografUser + deleteChronografUser: typeof deleteChronografUser createOrg: typeof createOrg deleteOrg: typeof deleteOrg createInfluxDBUser: typeof createInfluxDBUser diff --git a/ui/cypress/integration/dashboard.test.ts b/ui/cypress/integration/dashboard.test.ts index 06ead4a42..73d810c90 100644 --- a/ui/cypress/integration/dashboard.test.ts +++ b/ui/cypress/integration/dashboard.test.ts @@ -39,8 +39,8 @@ describe('Use Dashboards', () => { describe('Use Dashboards as reader', () => { beforeEach(() => { - cy.deleteUser('Reader') - cy.createUser('Reader', 'oauth-mock', 'oauth2') + cy.deleteChronografUser('Reader') + cy.createChronografUser('Reader', 'oauth-mock', 'oauth2') cy.OAuthLoginAsDiffUser('Reader') }) diff --git a/ui/cypress/support/commands.ts b/ui/cypress/support/commands.ts index 5cee69266..71b4a9c9f 100644 --- a/ui/cypress/support/commands.ts +++ b/ui/cypress/support/commands.ts @@ -107,19 +107,17 @@ export const removeConnections = () => { } export const createDashboard = (name?: string) => { - return cy.fixture('routes').then(({dashboards}) => { - return cy - .request({ - method: 'POST', - url: `/chronograf/v1${dashboards}`, - body: { - name: name ?? 'Default Dashboard', - }, - }) - .then(() => { - wrapDashboards() - }) - }) + return cy + .request({ + method: 'POST', + url: '/chronograf/v1/dashboards', + body: { + name: name ?? 'Default Dashboard', + }, + }) + .then(() => { + wrapDashboards() + }) } export const deleteDashboards = () => { @@ -349,8 +347,8 @@ Cypress.Commands.add('createDashboardWithCell', createDashboardWithCell) Cypress.Commands.add('OAuthLogin', OAuthLogin) Cypress.Commands.add('OAuthLogout', OAuthLogout) Cypress.Commands.add('OAuthLoginAsDiffUser', OAuthLoginAsDiffUser) -Cypress.Commands.add('createUser', createUser) -Cypress.Commands.add('deleteUser', deleteUser) +Cypress.Commands.add('createChronografUser', createChronografUser) +Cypress.Commands.add('deleteChronografUser', deleteChronografUser) Cypress.Commands.add('createOrg', createOrg) Cypress.Commands.add('deleteOrg', deleteOrg) Cypress.Commands.add('createInfluxDBUser', createInfluxDBUser) @@ -358,4 +356,4 @@ Cypress.Commands.add('deleteInfluxDBUser', deleteInfluxDBUser) Cypress.Commands.add('createInfluxDBRole', createInfluxDBRole) Cypress.Commands.add('deleteInfluxDBRole', deleteInfluxDBRole) Cypress.Commands.add('createInfluxDB', createInfluxDB) -Cypress.Commands.add('deleteInfluxDB', deleteInfluxDB) \ No newline at end of file +Cypress.Commands.add('deleteInfluxDB', deleteInfluxDB)