0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
posthog/cypress/integration/cohorts.js
Karl-Aksel Puulmann f36495bec6
Filters: Select multiple for equality/inequality (#3422)
* Don't colorize sql for output

* Handle setting array props as values

* Handle arrays exact/is_not property filters

Also updates tests to use parameterization

* Avoid autoclosing PropertyFilter popup

As key changes, old one got removed from DOM

* Improve filter UX

Don't allow filter to become multi-line and keep inputs the same size.

Previous flex={1} was doing flex: 1 1 auto which was messing things up

* Fix typescript issue

* Handle array lookups in postgres

* Update types

* Fix fixture to recreate tables

* Make replace spaces logic consistent with what was there before

* Handle list filtering better in postgres

* Update frontend tests

* Handle edge case: Switching between multi operator and single operators
2021-02-25 16:54:55 +02:00

36 lines
1.3 KiB
JavaScript

describe('Cohorts', () => {
beforeEach(() => {
cy.get('[data-attr=menu-item-cohorts]').click()
})
it('Cohorts new and list', () => {
// load an empty page
cy.get('h1').should('contain', 'Cohorts')
cy.title().should('equal', 'Cohorts • PostHog')
// go to create a new cohort
cy.get('[data-attr="create-cohort"]').click()
cy.get('[data-attr="cohort-choice-definition"]').click()
cy.get('[data-attr="cohort-name"]').type('Test Cohort')
// select "add filter" and "property"
cy.get('.ant-radio-group > :nth-child(2)').click()
cy.get('[data-attr="new-prop-filter-cohort_0"]').click()
// select the first property
cy.get('[data-attr=property-filter-dropdown]').click()
cy.get('[data-attr=prop-filter-person-0]').click({ force: true })
cy.get('[data-attr=prop-val]').click()
cy.get('[data-attr=prop-val-0]').click({ force: true })
cy.get('[data-attr="cohort-name"]').click()
// save
cy.get('[data-attr="save-cohort"]').click()
cy.get('[data-attr=success-toast]').should('exist')
// back to cohorts
cy.get('.ant-drawer-close').click({ force: true })
cy.get('.ant-table-tbody').contains('Test Cohort')
})
})