-
Notifications
You must be signed in to change notification settings - Fork 134
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
Conversation
Size Change: 0 B Total Size: 719 kB ℹ️ View Unchanged
|
// 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', | ||
}) |
There was a problem hiding this comment.
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
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' }) | ||
}) |
There was a problem hiding this comment.
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
Does what it says on the tin