-
Notifications
You must be signed in to change notification settings - Fork 930
Add Firefox testing to Auth #6522
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
Conversation
|
Changeset File Check ✅
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (88,843 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
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.
Can you add a description? That's a good place to explain the plan overall plus any unusual changes (like spy vs stub?)
@@ -73,28 +70,28 @@ describe('platform_cordova/popup_redirect/events', () => { | |||
|
|||
describe('_savePartialEvent', () => { | |||
it('sets the event', async () => { | |||
const spy = sinon.spy(Storage.prototype, 'setItem'); |
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.
Can you explain why there is a change from stub to spy?
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.
I was having issues with the stub at one point and the test only required verifying if the method was called so stubbing out a return value was not necessary for the test itself.
'firebase:authEvent:test-api-key:test-app', | ||
JSON.stringify(event) | ||
); | ||
spy.calledWith('firebase:authEvent:test-api-key:test-app', |
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.
Does this not need to be wrapped in expect()?
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.
Yes, adding it now
JSON.stringify(event) | ||
); | ||
spy.calledWith('firebase:authEvent:test-api-key:test-app', | ||
JSON.stringify(event)); |
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.
What is this for?
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.
per https://blog.logrocket.com/storing-retrieving-javascript-objects-localstorage/, In the code block, we used the JSON.stringify() method to convert our JavaScript object into a string first because we can only store strings in the window.localStorage object.
I didn't add the json stringify part. It was part of the original test.
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.
Oh, sorry! I didn't see this was a line wrapping, weird indent.
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.
Actually when I pasted it in and ran prettier inside VSCode, it indented it (the current version):
expect(storageStub.calledWith('firebase:authEvent:test-api-key:test-app',
JSON.stringify(event))).to.be.true;
Weird the formatter check didn't catch this? I ran yarn format and it didn't work but it does if I run prettier inside VSCode.
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.
We also have webdriver tests, but those are explicitly disabled in Firefox due to weird timing issues that we couldn't resolve. I don't imagine that's fixed now but just wanted to highlight
packages/auth/src/platform_cordova/popup_redirect/events.test.ts
Outdated
Show resolved
Hide resolved
'firebase:authEvent:test-api-key:test-app' | ||
); | ||
)).to.be.true; |
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.
Same here
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.
Approved pending comments
No description provided.