Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions cypress/e2e/cloud/userAccounts.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {Organization} from '../../../src/types'
import {makeQuartzUseIDPEOrgID} from 'cypress/support/Utils'

// This variable stores the current IDPE orgid and syncs it with the quartz-mock orgid.
Expand Down Expand Up @@ -59,12 +58,17 @@ const setupTest = (setupParams: SetupParams) => {
)
}

const doSetup = cy => {
const doSetup = () => {
cy.flush().then(() => {
cy.signin().then(() => {
cy.get('@org').then(({id}: Organization) => {
// Fetch org directly to avoid race condition with @org alias
cy.request({
method: 'GET',
url: 'api/v2/orgs',
}).then(res => {
const orgId = res.body.orgs?.[0]?.id
cy.intercept('GET', 'api/v2/quartz/orgs/**/users').as('getOrgsUsers')
cy.visit(`/orgs/${id}/accounts/settings`)
cy.visit(`/orgs/${orgId}/accounts/settings`)
cy.wait('@getOrgsUsers')
})
})
Expand All @@ -85,7 +89,7 @@ describe('Account Page tests', () => {
{id: 415, isActive: false, isDefault: true, name: 'Veganomicon'},
],
})
doSetup(cy)
doSetup()
})

it('can get to the account page and rename the active account', () => {
Expand Down Expand Up @@ -169,7 +173,7 @@ describe('Free account Deletion', () => {
.click()
})
cy.location().should(loc => {
expect(loc.href).to.eq(`https://www.influxdata.com/mkt-cancel/`)
expect(loc.href).to.include('https://www.influxdata.com/mkt-cancel')
})
})
}
Expand Down