2024-06-24 18:44:15 +02:00
|
|
|
import { urls } from 'scenes/urls'
|
|
|
|
|
2021-05-01 03:21:23 +02:00
|
|
|
// For tests related to team members administration please see `inviteMembers.js`
|
2021-02-04 12:26:38 +01:00
|
|
|
describe('Organization settings', () => {
|
2024-06-24 18:44:15 +02:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.intercept('/api/billing/', { fixture: 'api/billing/billing.json' })
|
|
|
|
cy.useSubscriptionStatus('subscribed')
|
|
|
|
})
|
2021-02-04 12:26:38 +01:00
|
|
|
it('can navigate to organization settings', () => {
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.get('[data-attr=menu-item-me]').click()
|
2021-02-04 12:26:38 +01:00
|
|
|
cy.get('[data-attr=top-menu-item-org-settings]').click()
|
2023-11-09 10:08:33 +01:00
|
|
|
cy.location('pathname').should('include', '/settings/organization')
|
2021-02-04 12:26:38 +01:00
|
|
|
})
|
2024-06-24 18:44:15 +02:00
|
|
|
it('can create a new organization', () => {
|
|
|
|
cy.visit(urls.settings('organization'), {
|
|
|
|
onLoad(win: Cypress.AUTWindow) {
|
|
|
|
;(win as any).POSTHOG_APP_CONTEXT.preflight.cloud = true
|
|
|
|
},
|
|
|
|
})
|
|
|
|
cy.get('[data-attr=breadcrumb-organization]').click()
|
|
|
|
cy.get('[data-attr=new-organization-button]').click()
|
|
|
|
cy.get('[data-attr=organization-name-input]').type('New Organization')
|
|
|
|
cy.get('[data-attr=create-organization-ok]').click()
|
|
|
|
cy.get('[data-attr=organization-name-input-settings]').should('have.value', 'New Organization')
|
|
|
|
})
|
|
|
|
it('can delete an organization', () => {
|
|
|
|
cy.visit(urls.settings('organization'), {
|
|
|
|
onLoad(win: Cypress.AUTWindow) {
|
|
|
|
;(win as any).POSTHOG_APP_CONTEXT.preflight.cloud = true
|
|
|
|
},
|
|
|
|
})
|
|
|
|
cy.get('[data-attr=organization-name-input-settings]').should('have.value', 'New Organization')
|
|
|
|
cy.get('[data-attr=delete-organization-button]').click()
|
|
|
|
cy.get('[data-attr=delete-organization-confirmation-input]').type('New Organization')
|
|
|
|
cy.get('[data-attr=delete-organization-ok]').click()
|
|
|
|
// it redirects to the homepage after deleting the organization
|
|
|
|
cy.get('[data-attr=organization-name-input-settings]').should('not.exist')
|
|
|
|
cy.get('[data-attr=top-bar-name]').should('contain.text', 'Homepage')
|
|
|
|
})
|
2021-02-04 12:26:38 +01:00
|
|
|
})
|