0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/cypress/e2e/licenses.cy.ts
Raquel Smith bac246a98e
chore: hook pricing table to billing service plans (#13857)
* Get rid of control version

* Don't show option to license on billing page

* Remove ff constant

* Include plans in billing response

* Update types for the plans

* Hook up the top of the table

* Fill out the rest of the table

* Hook up the rest of the table

* Add tooltip with feature descriptions

* Fix type errors

* Fix more type issues

* Remove old plan data

* clean up

* exclude features we don't want to show in table

* Tolerate missing plan keys

* fix mypy

* Update cypresss test

* Fix mypy again

* Just get whatever default plans

* fix tests

* Update snapshots

* Update snapshots

* moar test fixes

* use is_free to know if free plan

* Say the free allotment is incl'd if base has $ price

* Update snapshots

* Don't change anything having to do with licenses

* Fix type error

* Update snapshots

* Update snapshots

* Use product name from stripe

* only lowercase

* don't hardcode plan names

Co-authored-by: Emanuele Capparelli <k@emkpp.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-26 16:04:30 +00:00

24 lines
1.1 KiB
TypeScript

import { urls } from 'scenes/urls'
describe('Licenses', () => {
it('Licenses loaded for billing v1', () => {
cy.intercept('GET', '/api/billing-v2**', { statusCode: 500 }).as('billingServerFailure')
cy.visit(urls.savedInsights())
cy.wait('@billingServerFailure')
cy.get('[data-attr=top-menu-toggle]').click()
cy.get('[data-attr=top-menu-item-licenses]').click()
cy.get('[data-attr=breadcrumb-0]').should('contain', Cypress.config().baseUrl.replace('http://', '')) // Breadcrumbs work
cy.get('[data-attr=breadcrumb-1]').should('have.text', 'Licenses') // Breadcrumbs work
cy.get('h1').should('contain', 'Licenses')
cy.title().should('equal', 'Licenses • PostHog') // Page title works
})
it('License page not visible on billing v2', () => {
cy.intercept('GET', '/api/billing-v2**', { statusCode: 200 }).as('billingServerSuccess')
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')
})
})