-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: a bunch of heatmaps bugs (#25743)
- Loading branch information
1 parent
b210407
commit 68d2c10
Showing
6 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
Binary file modified
BIN
-46 Bytes
(100%)
frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-41 Bytes
(100%)
frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { withoutPostHogInit } from '~/toolbar/stats/currentPageLogic' | ||
|
||
const posthogInitHashParam = | ||
'__posthog={%22action%22:%20%22ph_authorize%22,%20%22token%22:%20%the-ph-token%22,%20%22temporaryToken%22:%20%the-posthog-token%22,%20%22actionId%22:%20null,%20%22userIntent%22:%20%22heatmaps%22,%20%22toolbarVersion%22:%20%22toolbar%22,%20%22apiURL%22:%20%22https://eu.posthog.com%22,%20%22dataAttributes%22:%20[%22data-attr%22],%20%22jsURL%22:%20%22https://app-static.eu.posthog.com%22,%20%22instrument%22:%20true,%20%22userEmail%22:%20%[email protected]%22,%20%22distinctId%22:%20%the-distinct-id%22}' | ||
|
||
describe('current page logic', () => { | ||
describe('cleaning href', () => { | ||
it('can ignore posthog init hash param when other hash params present', () => { | ||
// not technically a valid URL but :shrug: | ||
expect(withoutPostHogInit(`https://wat.io?something=a#${posthogInitHashParam}#myfragment`)).toBe( | ||
'https://wat.io/?something=a#myfragment' | ||
) | ||
}) | ||
it('can handle multiple curly braces in the init', () => { | ||
// not technically a valid URL but :shrug: | ||
expect( | ||
withoutPostHogInit( | ||
`https://wat.io?something=a#__posthog={something}and something}#myfragment={something}` | ||
) | ||
).toBe('https://wat.io/?something=a#myfragment={something}') | ||
}) | ||
it('can ignore posthog init hash param when no other hash params present', () => { | ||
expect(withoutPostHogInit(`https://wat.io?something=a#${posthogInitHashParam}`)).toBe( | ||
'https://wat.io/?something=a' | ||
) | ||
}) | ||
it('gives nonsense back if it receives it', () => { | ||
expect(withoutPostHogInit('i am not a url')).toBe('i am not a url') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters