Skip to content

Commit

Permalink
Update E2E tests to check for disabled state
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Aug 1, 2024
1 parent 20015fa commit 5bc3b1c
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions test/e2e/frontend/cypress/tests/team/billing.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('FlowForge - Team Billing', () => {
})

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

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

cy.wait('@getTeams')

cy.url().should('include', '/team/ateam/billing')

cy.get('[data-nav="team-applications"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="team-instances"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="team-devices"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="shared-library"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="team-members"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="team-audit"').click()
cy.url().should('include', '/team/ateam/billing')
cy.get('[data-nav="team-billing"').click()
cy.url().should('include', '/team/ateam/billing')

cy.get('[data-nav="team-settings"').click()
cy.url().should('include', '/team/ateam/settings/general')
})
it('cannot interact with navigation options other than Team Settings & Billing', () => {
cy.get('[data-nav="team-applications"').should('have.class', 'disabled')
cy.get('[data-nav="team-instances"').should('have.class', 'disabled')
cy.get('[data-nav="team-devices"').should('have.class', 'disabled')
cy.get('[data-nav="shared-library"').should('have.class', 'disabled')
cy.get('[data-nav="team-members"').should('have.class', 'disabled')
cy.get('[data-nav="team-audit"').should('have.class', 'disabled')
cy.get('[data-nav="team-billing"').should('not.have.class', 'disabled')
cy.get('[data-nav="team-settings"').should('not.have.class', 'disabled')
})

it('allows admins to navigate the team', () => {
Expand Down Expand Up @@ -131,7 +121,7 @@ describe('FlowForge - Team Billing', () => {
cy.get('[data-nav="team-audit"').click()
cy.url().should('include', '/team/ateam/audit-log')
cy.get('[data-nav="team-billing"').click()
cy.url().should('include', '/team/ateam/billing')
cy.url().should('include', `/team/${TEAM}/billing`)
cy.get('[data-nav="team-settings"').click()
cy.url().should('include', '/team/ateam/settings/general')
})
Expand Down

0 comments on commit 5bc3b1c

Please sign in to comment.