Skip to content

Commit 5bc3b1c

Browse files
author
Joe Pavitt
committed
Update E2E tests to check for disabled state
1 parent 20015fa commit 5bc3b1c

1 file changed

Lines changed: 12 additions & 22 deletions

File tree

test/e2e/frontend/cypress/tests/team/billing.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('FlowForge - Team Billing', () => {
5353
})
5454

5555
describe('Cancelled subscriptions', () => {
56-
it('redirects regular users to the billing page', () => {
56+
beforeEach(() => {
5757
cy.login('bob', 'bbPassword')
5858

5959
cy.intercept('GET', '/api/v1/teams/*', (req) => req.reply(res => {
@@ -76,26 +76,16 @@ describe('FlowForge - Team Billing', () => {
7676
cy.visit('/')
7777

7878
cy.wait('@getTeams')
79-
80-
cy.url().should('include', '/team/ateam/billing')
81-
82-
cy.get('[data-nav="team-applications"').click()
83-
cy.url().should('include', '/team/ateam/billing')
84-
cy.get('[data-nav="team-instances"').click()
85-
cy.url().should('include', '/team/ateam/billing')
86-
cy.get('[data-nav="team-devices"').click()
87-
cy.url().should('include', '/team/ateam/billing')
88-
cy.get('[data-nav="shared-library"').click()
89-
cy.url().should('include', '/team/ateam/billing')
90-
cy.get('[data-nav="team-members"').click()
91-
cy.url().should('include', '/team/ateam/billing')
92-
cy.get('[data-nav="team-audit"').click()
93-
cy.url().should('include', '/team/ateam/billing')
94-
cy.get('[data-nav="team-billing"').click()
95-
cy.url().should('include', '/team/ateam/billing')
96-
97-
cy.get('[data-nav="team-settings"').click()
98-
cy.url().should('include', '/team/ateam/settings/general')
79+
})
80+
it('cannot interact with navigation options other than Team Settings & Billing', () => {
81+
cy.get('[data-nav="team-applications"').should('have.class', 'disabled')
82+
cy.get('[data-nav="team-instances"').should('have.class', 'disabled')
83+
cy.get('[data-nav="team-devices"').should('have.class', 'disabled')
84+
cy.get('[data-nav="shared-library"').should('have.class', 'disabled')
85+
cy.get('[data-nav="team-members"').should('have.class', 'disabled')
86+
cy.get('[data-nav="team-audit"').should('have.class', 'disabled')
87+
cy.get('[data-nav="team-billing"').should('not.have.class', 'disabled')
88+
cy.get('[data-nav="team-settings"').should('not.have.class', 'disabled')
9989
})
10090

10191
it('allows admins to navigate the team', () => {
@@ -131,7 +121,7 @@ describe('FlowForge - Team Billing', () => {
131121
cy.get('[data-nav="team-audit"').click()
132122
cy.url().should('include', '/team/ateam/audit-log')
133123
cy.get('[data-nav="team-billing"').click()
134-
cy.url().should('include', '/team/ateam/billing')
124+
cy.url().should('include', `/team/${TEAM}/billing`)
135125
cy.get('[data-nav="team-settings"').click()
136126
cy.url().should('include', '/team/ateam/settings/general')
137127
})

0 commit comments

Comments
 (0)