0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:49:32 +01:00
Commit Graph

8 Commits

Author SHA1 Message Date
Marius Andra
ef70592603
Usable logic tests (works now!) (#5990)
* mockup usable logic tests

* actually filter

* a little verbosity never hurt anyone

* await

* sync toDispatchActions and toMatchValues working

* get at least one test working

* should await this

* better action awaiting

* cleanup

* smarter logic test action matching

* cleanup

* delete snapshots

* fix titles

* remove .run(), add .then-magic

* cleanup

* more cleanup

* refactor into multiple files

* refactor into multiple files WIP

* finish refactor

* make nodejs compatible

* funnel logic test WIP

* delay and printActions

* fix label

* add more mocks

* only call action if it makes sense

* fix reload issue with funnels and actions

* explicitly connect to this logic

* listener and mount functions for kea-test-utils

* improve tests

* mock out scss files

* rename antd es/ to lib/ for compatibility in jest

* add breakdown test

* funnel test updates

* set pointer to now if running a block with expectLogic

* fix mock

* more mock

* ignore if breakpoint

* reset window history and posthog-js with logic tests

* one more breakpoint

* add test mode ecxeptions

* update kea

* improve funnel test

* merge, but break

* add safeguard

* safer props

* fix test bugs

* clarify window.crypto polyfill

* simplify api.mock

* simple throw if unmocked api

* use a global actionMap pointer, so we could query between logics

* use the global querying

* remove "Scene" hack

* fix type bug

* clarify some variables
2021-09-21 13:39:05 +02:00
Michael Matloka
336fd16709
Fix issue with importing PropertyKeyInfo.scss in Jest test (#5577) 2021-08-13 00:45:19 +00:00
Marius Andra
535256cf69
Logic tests again (#5234)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-23 23:58:29 +00:00
Marius Andra
19d9fcc9ed
Funnel default event (#5280)
* get default event name directly from django

* default event name in the backend

* fix "~/" urls in jest tests

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-22 17:57:41 +02:00
Karl-Aksel Puulmann
30b6692920
React component tests with cypress (#3233)
* WIP: get cypress something doing

* Get a test running

* Get css loading, stub posthog

* Move helpers to separate file

* Givens > given2

It plays nicer with beforeEach

* Test for session filters

* Test date navigation

* Test filtering

* Try keep old tests running

* Try get tests running under CI

* Prettify fixtures

* Cleanup, use cypress 6

* Add yarn build

* Fix e2e cypress tests

* given2 => givens

* Rename `frontend-test-runner` to `e2e-test-runner`

* Fix cypress test

* Add webpack-preprocessor as a devDependency

* Improve freezing time

* Make css inclusions automatic for component tests
2021-02-09 17:28:01 +02:00
Karl-Aksel Puulmann
157003e2ab
Tests, fix for createActionFromEvent, clean up sessions query (#2851)
* Remove a dead TODO

This was solved in PR  #1849

* Make sessions query more readable

* Remove dead code from sessions

* Make it possible to test with imports in jest

* Fix a bug and add tests to createActionFromEvent

I added tests when initially solving #2848, but the original solution
had to be scrapped. The tests are still valid though
2021-01-05 17:11:24 +02:00
Karl-Aksel Puulmann
4aedc4317a
Add event (sum of event_property) to event labels on graphs (#2583)
* Use standard jest test formatting

* Use js instead of ts in tests

* Add given2 as dependency

* Document existing behavior of formatLabel()

* Add `event (sum of event_property)` to event labels on graphs

I found the current state impossible to read when trying to see through
session recording metrics
2020-12-01 16:01:36 +02:00
Paolo D'Amico
bbd2cf2a27
Refactor camelCase util (#2487)
* refactor camelCaseToTitle

* Rework identifierToHuman

* Test identifierToHuman with Jest

* Add Jest to frontent CI

Co-authored-by: Michael Matloka <dev@twixes.com>
2020-11-24 16:07:36 +01:00