0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 17:54:41 +01:00
posthog/cypress/integration/dashboardPremium.js
Tim Glaser bb572272ca
Improve e2e flakeyness, skip Insights spec test (#4869)
* attempt to fix toolbar flakyness

* fix dashboard flakyness

* fix flake

* add retries to components

* Try speeding up build by skipping sourcemaps

* debug components

* show errors

* better error

* don't generate source map

* fix errors

* speed up component tests

* Try empty insights page

* Revert "Try empty insights page"

This reverts commit 68701b3804.

* Skip trends tests for now
2021-06-29 22:20:02 +02:00

39 lines
1.5 KiB
JavaScript

describe('Dashboards Premium Features', () => {
beforeEach(() => {
cy.clickNavMenu('dashboards')
cy.location('pathname').should('include', '/dashboard')
})
it('Tag dashboard', () => {
const newTag = `test-${Math.floor(Math.random() * 10000)}`
cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
cy.get('[data-attr=button-add-tag]').click()
cy.focused().type(newTag)
cy.get('[data-attr=new-tag-option]').click()
cy.get('.ant-tag').should('contain', newTag)
cy.wait(300)
cy.get('.new-tag-input').should('not.exist') // Input should disappear
cy.clickNavMenu('dashboards')
cy.get('.ant-tag').should('contain', newTag) // Tag is shown in dashboard list too
})
it('Cannot add duplicate tags', () => {
const newTag = `test2-${Math.floor(Math.random() * 10000)}`
cy.get('[data-attr=dashboard-name]').contains('App Analytics').click()
cy.get('[data-attr=button-add-tag]').click()
cy.focused().type(newTag)
cy.get('[data-attr=new-tag-option]').click()
cy.get('.ant-tag').should('contain', newTag)
cy.wait(300)
cy.get('[data-attr=button-add-tag]').click()
cy.focused().type(newTag)
cy.get('[data-attr=new-tag-option]').click()
cy.get('.Toastify__toast--error').should('be.visible')
cy.get('.dashboard').find('.ant-tag').contains(newTag).should('have.length', 1)
})
})