Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: convert 2 more test files to remove given and switch to TS #882

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

pauldambra
Copy link
Member

Does what it says on the tin

Copy link

github-actions bot commented Nov 8, 2023

Size Change: 0 B

Total Size: 719 kB

ℹ️ View Unchanged
Filename Size
dist/array.full.js 172 kB
dist/array.js 114 kB
dist/es.js 114 kB
dist/exception-autocapture.js 12 kB
dist/module.js 114 kB
dist/recorder-v2.js 95 kB
dist/recorder.js 58.3 kB
dist/surveys.js 39.7 kB

compressed-size-action

@pauldambra pauldambra requested a review from a team November 9, 2023 08:41
@pauldambra pauldambra changed the title chore: convert more tests to given and TS chore: convert 2 more test files to remove given and switch to TS Nov 9, 2023
Comment on lines +104 to +113
// if the hash state does not contain ph_authorize then look in storage
localStorage.getItem.mockImplementation(() => JSON.stringify(toolbarParams))

const hashState = { ...defaultHashState, action: undefined }
toolbar.maybeLoadToolbar(aLocation(withHash(withHashParamsFrom(hashState))), localStorage, history)

expect(toolbar.loadToolbar).toHaveBeenCalledWith({
...toolbarParams,
source: 'localstorage',
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test changed as well as being converted. it wasn't actually testing what it claimed it was, it's still maybe too confusing

Comment on lines +129 to +136
it('should work if calling toolbar params `__posthog`', () => {
toolbar.maybeLoadToolbar(
aLocation(withHash(withHashParamsFrom(defaultHashState, '__posthog'))),
localStorage,
history
)
expect(toolbar.loadToolbar).toHaveBeenCalledWith({ ...toolbarParams, ...defaultHashState, source: 'url' })
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test changed as well as being converted, it wasn't actually testing what it said it was

@pauldambra pauldambra merged commit 62d40fb into master Nov 9, 2023
15 checks passed
@pauldambra pauldambra deleted the chore/convert-more-given branch November 9, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants