0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-29 11:12:33 +01:00
posthog/cypress/integration/dashboardPremium.js
Michael Matloka 1bce7effaa
New DashboardHeader and better EditableField (#8146)
* Reimplement `EditableField` to be seamless

* Implement base of `LemonDashboardHeader`

* Get rid of `controlledMode`

* Make in-progress dashboard updates tentatively apply in local state

* Add `sharedDashboard` to `urls`

* Complete new `DashboardHeader`

* Iterate on `EditableField`

* Use simpler terms for editing layout

* Update dashboardPremium.js

* Fix saving tags

* Improve EditableField sizing

* Reposition Popup on size change

* Remove LemonButton-in-Popup magic

* Remove `updateDashboard` pre-saving

* Use muted color only for the placeholder

* Add payment gate to descriptions

* Update LemonDashboardHeader.tsx

* Update dashboard.js

* Revert "Update dashboard.js"

This reverts commit 50cf72d549.
2022-01-22 01:27:30 +01:00

37 lines
1.4 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.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)
})
})