0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00
Commit Graph

26 Commits

Author SHA1 Message Date
David Newell
362d05f65d
chore: remove antd (#24256) 2024-08-14 09:54:37 +01:00
Marius Andra
807ba424b2
feat(hogql): inline hogql editor with autocomplete (#23247) 2024-06-28 08:16:53 +02:00
David Newell
ed87468351
feat: canvas replay (#19583) 2024-01-22 15:54:07 +00:00
Paul D'Ambra
16323959fd
feat: add ee licensed replay transformer (#18874)
first pass through using the EE licensed replay transformer in playback

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Newell <d.newell1@outlook.com>
2023-11-29 10:41:18 +00:00
Ben White
4ad3928c74
feat: Added ability to import code from ee folder (#18841)
We want to experiment with some conditional licensing of frontend code via the ee folder.

---------

Co-authored-by: Paul D'Ambra <paul@posthog.com>
2023-11-23 16:40:46 +00:00
Paul D'Ambra
36f08cecac
chore: upgrade d3 (#14442)
* chore: upgrade d3

* Update UI snapshots for `chromium` (1)

* fix test module mapping

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-28 13:32:13 +00:00
Paul D'Ambra
a7f5db0091
feat: use a different css selector generator in the toolbar (#13937)
* feat: use a different css selector generator in the toolbar

* get jest running the tests

* update tests for finder library

* remove simmer entirely

* simplify wildcard match

* remove test

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2023-01-27 08:24:06 +00:00
Marius Andra
5b44f9c96a
chore: switch from esbuild-jest to sucrase for frontend tests (#13636) 2023-01-11 11:35:15 +01:00
Thomas Obermüller
4a30e78b22
chore: use pnpm to manage dependencies (closes #12635) (#13190)
* chore: use pnpm to manage dependencies

* Fix CI errors

* Don't report Docker image size for external PRs

* Fix pnpm-lock.yaml formatting

* Fix module versions

* Ignore pnpm-lock.yaml

* Upgrade Cypress action for pnpm support

* Set up node and pnpm before Cypress

* Fix typescript issues

* Include patches directory in Dockerfile

* Fix Jest tests in CI

* Update lockfile

* Update lockfile

* Clean up Dockerfile

* Update pnpm-lock.yaml to reflect current package.json files

* remove yarn-error.log from .gitignore

* formatting

* update data exploration readme

* type jest.config.ts

* fix @react-hook issues for jest

* fix react-syntax-highlighter issues for jest

* fix jest issues from query-selector-shadow-dom

* fix transform ignore patterns and undo previous fixes

* add missing storybook peer dependencies

* fix nullish coalescing operator for storybook

* reorder storybook plugins

* update editor-update-tsd warning to new npm script

* use legacy ssl for chromatic / node 18 compatibility

* use pnpm for visual regression testing workflow

* use node 16 for chromatic

* add @babel/plugin-proposal-nullish-coalescing-operator as direct dependency

* try fix for plugin-server

* cleanup

* fix comment and warning

* update more comments

* update playwright dockerfile

* update plugin source types

* conditional image size reporting

* revert react-native instructions

* less restrictive pnpm verions

* use ref component name in line with style guide

Co-authored-by: Jacob Gillespie <jacobwgillespie@gmail.com>
2022-12-12 10:28:06 +01:00
Marius Andra
8d2d88ebe8
chore(frontend): upgrade jest (#12866)
* upgrade to jest 27

* mock billing errors

* upgrade to 28

* do that thing where I remove a broken test and hope nobody catches that in a review

* upgrade to 29

* update snapshots

* change to esbuild-jest

* fix config

* make tests compatible with esbuild
2022-11-19 13:09:00 +01:00
Paul D'Ambra
0c34a2ab3b
chore: allow overriding jest timezone (#12261) 2022-10-14 14:18:31 +00:00
Paul D'Ambra
be11df8177
fix: lock jest tests to UTC (#12245) 2022-10-13 18:50:54 +00:00
Alex Gyujin Kim
a3f5bd740e
feat(recordings): make player events expandable (#11584) 2022-09-06 20:15:40 +00:00
Marius Andra
2069c4cd8b
feat(frontend): build @posthog/lemon-ui and @posthog/apps-common (#10120)
* fix dayjs

* fix timeouts (we're not strictly speaking running in nodejs)

* export unexported type

* consolidate on a single FormInstance

* no need to rename

* fuse

* forminstance 2

* locationChanged

* BuiltLogic

* remove Type.ts exception

* fix duh

* playing with common apps

* playing with common apps

* fix some scss deprecations 🤷

* revert

* move packages/apps-common

* remove compiled json file

* build apps-common before other packages

* mkdirp, build types before running

* build types before the rest

* move imports json to packages folder

* mark some packages as external, saving 200kb

* revert nonsense

* remove ant dep

* make app source editor types optional for speed

* move dev server reloads to utils.mjs

* remove webpack start scripts (unused)

* refactor build/utils to support various dirs

* apps package

* revert some stuff

* yarn

* go back to the old location and commit packages.json in

* commit it in

* out of scope

* fix bad imports

* fix some postcss mess

* move to @posthog/apps-common

* add more stuff to apps

* include that in packages.json

* simple cjs build

* export everything

* simplify

* make separate package for lemonade

* more lemonade

* fix jest imports

* fix jest imports

* yarn as well

* src

* write types before building

* rename lemon-ui, part 1

* add readmes

* rename to lemon-ui, part 2

* this app source editor tsd is committed into the repo, so we don't need it before a build
2022-06-10 17:03:06 +02:00
Marius Andra
6ba92b4766
feat(frontend): use lottie for animation (#9904)
* add lottie-react

* test loading states

* add new animations

* adopt the laptophog as the loadinghog

* handle opacity via a class

* move all lottiefiles to lib/animations

* new animation component

* add storybook

* use sportshog and laptophog animations for loading

* jest also wants to ignore these files

* clarify text

* support canvas in jsdom / jest

* add width/height to animations

* clarify

* use a mocked canvas instead of installing new debian packages to get this to compile

* I posted a wrong answer on the internet

Co-authored-by: Michael Matloka <dev@twixes.com>
2022-06-06 12:50:13 +02:00
Marius Andra
8f4520ec4f
refactor(jest): convert jest mocks to msw (#8902)
* use msw with jest

* use mocks in a test

* definition popup msw

* refactor another test

* refactor infiniteListLogic

* refactor api tests under lib/

* another set of logic refactors

* refactor dashboardLogic

* more refactors

* use features

* few more refactors

* refactor insightLogic

* refactor organizationLogic

* refactor eventDefinitionsTableLogic

* refactor sessionRecordingLogic

* refactor funnelLogic

* remove initKeaTestLogic

* fix mocks

* fix primaryDashboardModalLogic

* inline json

* remove comment
2022-03-08 16:05:33 +01:00
Marius Andra
13498eb98d
Taxonomic filter first tab (#7447) 2021-12-13 12:58:41 -07:00
Paul D'Ambra
a957f0abb0
adds a search box to the toolbar featureflag list (#6527)
* adds a search box to the toolbar featureflag list

* test flakes because react is re-rendering between the get and the click. add an assertion to try and slow cypress down to avoid this

* move filtering toolbar feature flags to a Set and out of CSS

* support initKeaTestLogic() with no args

* fix query-selector-all-deep jest bug

* add simple test case for feature flags logic

* combine selectors

* with more understanding of Fuse

* add simple test for flag filtering

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2021-10-20 22:02:02 +00:00
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