2022-11-08 14:06:06 +01:00
|
|
|
import { urls } from 'scenes/urls'
|
|
|
|
|
2020-08-14 11:23:55 +02:00
|
|
|
describe('Licenses', () => {
|
2022-11-08 14:06:06 +01:00
|
|
|
it('Licenses loaded for billing v1', () => {
|
2023-01-26 17:04:30 +01:00
|
|
|
cy.intercept('GET', '/api/billing-v2**', { statusCode: 500 }).as('billingServerFailure')
|
2022-11-08 14:06:06 +01:00
|
|
|
cy.visit(urls.savedInsights())
|
|
|
|
cy.wait('@billingServerFailure')
|
2021-11-11 21:20:01 +01:00
|
|
|
cy.get('[data-attr=top-menu-toggle]').click()
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('[data-attr=top-menu-item-licenses]').click()
|
2022-05-27 14:31:17 +02:00
|
|
|
cy.get('[data-attr=breadcrumb-0]').should('contain', Cypress.config().baseUrl.replace('http://', '')) // Breadcrumbs work
|
2021-12-07 10:58:28 +01:00
|
|
|
cy.get('[data-attr=breadcrumb-1]').should('have.text', 'Licenses') // Breadcrumbs work
|
2020-08-14 11:23:55 +02:00
|
|
|
cy.get('h1').should('contain', 'Licenses')
|
2021-12-07 10:58:28 +01:00
|
|
|
cy.title().should('equal', 'Licenses • PostHog') // Page title works
|
2020-08-14 11:23:55 +02:00
|
|
|
})
|
2022-11-08 14:06:06 +01:00
|
|
|
|
|
|
|
it('License page not visible on billing v2', () => {
|
2023-01-26 17:04:30 +01:00
|
|
|
cy.intercept('GET', '/api/billing-v2**', { statusCode: 200 }).as('billingServerSuccess')
|
2022-11-08 14:06:06 +01:00
|
|
|
cy.visit(urls.savedInsights())
|
|
|
|
cy.wait('@billingServerSuccess')
|
|
|
|
cy.get('[data-attr=top-menu-toggle]').click()
|
|
|
|
cy.get('[data-attr=top-menu-item-licenses]').should('not.exist')
|
|
|
|
})
|
2020-08-14 11:23:55 +02:00
|
|
|
})
|