0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/cypress
Paul D'Ambra b31dcbde7f
feat: many to many insights and dashboards 💖 turbo mode (#9604)
* add a m2m aware insight move behind feature flag

* update insight's dashboard list when we know it has changed

* slightly better failing test

* fix the mock

* first pass at caching different dashboard contexts separately

* Remove unnecessary

* add cypress test for multi dashboard addition

* don't register feature flag for all tests

* correct mock structure

* Update frontend/src/models/insightsModel.tsx

Co-authored-by: Marius Andra <marius.andra@gmail.com>

* simplify move to dashboard signature

* don't filter items in the items reducer

* update entire insight whenever the updateDashboardItem action is called

* fix trends cypress tests

* remove unused import

* remove unnecessary todo

* not passing a dashboard means don't filter by dashboard

* no need to send null anymore

* only let dashboard update an insight if it is in dashboard context

* skip the cypress test

* don't fight cypress, for now

* slightly better

* don't load any old version of an insight if it happens to be pressent on another dashboard

* read dashboard id from props when looking up matching insights

* try looking up insight in dashboardModel as well

* change to insight scene logic has no effect

* fix test setup

* slightly better namne

* expand the tests

* refactor tests

* try and trick cypress into passing in CI the same way it passes locally

* move info out of my brain and into the code

* try and trick cypress into passing in CI the same way it passes locally

* rename method and file

* one fewer thing to think about

* rename refactor

* complete file rename

* resolve naming nit

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2022-05-17 13:24:31 +01:00
..
fixtures
integration feat: many to many insights and dashboards 💖 turbo mode (#9604) 2022-05-17 13:24:31 +01:00
plugins
support
README.md
wait.py

Testing Feature Flags

The Cypress tests run with a PostHog instance that has no feature flags set up.

To test feature flags you can intercept the call to the decide endpoint

  // sometimes the system under test calls `/decide`
  // and sometimes it calls https://app.posthog.com/decide
  cy.intercept(/.*\/decide\/.*/, (req) =>
      req.reply(
          decideResponse({
                // add feature flags here, for e.g.
                // 'feature-flag-key': true,
          })
      )
  )