0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/cypress/integration/feature_flags.js
Tim Glaser f61e9c111b
517 feature flags (#1017)
* WIP #517 feature flags

* Fix default filters

* Move decide to its own file

* Bump posthog-js 1.2.2

* Fix decide endpoint

* Add logic, update posthog-js

* yarn lock

* update snippet

* Add cypress tests

* Add example code

* Fix example code

* Add tests for query size

* Add errors when trying to create feature flag with same key

* Add explanation comment

* Fix cypress tests

* Do caching of teams in Team model

* Use <= instead of <

* Instrumentation and fix

* Fix ci test

* Add patch for team

* Debug test

* It passed
2020-06-22 10:57:09 +02:00

25 lines
1.0 KiB
JavaScript

describe('Feature Flags', () => {
beforeEach(() => {
cy.visit('/experiments/feature_flags')
})
it('Create feature flag', () => {
cy.get('h1').should('contain', 'Feature Flags')
cy.get('[data-attr=new-feature-flag]').click()
cy.get('[data-attr=feature-flag-name')
.type('beta feature')
.should('have.value', 'beta feature')
cy.get('[data-attr=feature-flag-key').should('have.value', 'beta-feature')
cy.get('[data-attr=feature-flag-switch').click()
cy.get('[data-attr=feature-flag-submit').click()
cy.get('[data-attr=feature-flag-table').should('contain', 'beta feature')
cy.get('[data-attr=feature-flag-table] tr:first-child td:first-child').click()
cy.get('[data-attr=feature-flag-name')
.type(' updated')
.should('have.value', 'beta feature updated')
cy.get('[data-attr=feature-flag-submit').click()
cy.get('[data-attr=feature-flag-table').should('contain', 'beta feature updated')
})
})