Skip to content

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

Merged
merged 14 commits into from
Aug 15, 2022
Merged

Add Firefox testing to Auth #6522

merged 14 commits into from
Aug 15, 2022

Conversation

dwyfrequency
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2022

⚠️ No Changeset found

Latest commit: c52f331

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 9, 2022

Size Report 1

Affected Products

  • @firebase/database

    TypeBase (ac578e9)Merge (31c974b)Diff
    browser248 kB248 kB-648 B (-0.3%)
    esm5276 kB276 kB-574 B (-0.2%)
    main282 kB281 kB-574 B (-0.2%)
    module248 kB248 kB-648 B (-0.3%)
  • @firebase/database-compat/standalone

    TypeBase (ac578e9)Merge (31c974b)Diff
    main371 kB370 kB-574 B (-0.2%)
  • bundle

    TypeBase (ac578e9)Merge (31c974b)Diff
    database (Listen for child events)160 kB160 kB-230 B (-0.1%)
    database (Listen for value events + Detach listeners)160 kB160 kB-230 B (-0.1%)
    database (Listen for value events)160 kB160 kB-230 B (-0.1%)
    database (Read data once)157 kB159 kB+2.66 kB (+1.7%)
    database (Save data as transactions)162 kB162 kB-230 B (-0.1%)
  • firebase

    17 size changes

    TypeBase (ac578e9)Merge (31c974b)Diff
    firebase-analytics.js115 kB24.9 kB-89.6 kB (-78.2%)
    firebase-app-check.js90.9 kB21.7 kB-69.2 kB (-76.2%)
    firebase-auth-cordova.js472 kB137 kB-335 kB (-70.9%)
    firebase-auth-react-native.js498 kB148 kB-350 kB (-70.2%)
    firebase-auth.js418 kB116 kB-302 kB (-72.2%)
    firebase-compat.js795 kB794 kB-413 B (-0.1%)
    firebase-database-compat.js166 kB166 kB-413 B (-0.2%)
    firebase-database.js606 kB153 kB-453 kB (-74.7%)
    firebase-firestore-lite.js267 kB86.1 kB-181 kB (-67.8%)
    firebase-firestore.js852 kB312 kB-539 kB (-63.3%)
    firebase-functions.js32.0 kB6.93 kB-25.1 kB (-78.4%)
    firebase-installations.js59.6 kB12.5 kB-47.1 kB (-79.0%)
    firebase-messaging-sw.js107 kB26.0 kB-81.4 kB (-75.8%)
    firebase-messaging.js106 kB24.8 kB-81.2 kB (-76.6%)
    firebase-performance.js123 kB30.7 kB-92.6 kB (-75.1%)
    firebase-remote-config.js113 kB26.4 kB-86.4 kB (-76.6%)
    firebase-storage.js146 kB36.7 kB-109 kB (-74.9%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/4jy7PEmCTN.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 9, 2022

Size Analysis Report 1

This 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

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/FgABt5QWLO.html

Copy link
Contributor

@hsubox76 hsubox76 left a 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');
Copy link
Contributor

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?

Copy link
Contributor Author

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',
Copy link
Contributor

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()?

Copy link
Contributor Author

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));
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@dwyfrequency dwyfrequency marked this pull request as ready for review August 12, 2022 20:22
Copy link
Contributor

@sam-gc sam-gc left a 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

'firebase:authEvent:test-api-key:test-app'
);
)).to.be.true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor

@sam-gc sam-gc left a comment

Choose a reason for hiding this comment

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

Approved pending comments

@dwyfrequency dwyfrequency merged commit dc7574e into master Aug 15, 2022
@dwyfrequency dwyfrequency deleted the jd-firefox-cross-browser branch August 15, 2022 20:03
@dwyfrequency dwyfrequency restored the jd-firefox-cross-browser branch August 16, 2022 18:56
@firebase firebase locked and limited conversation to collaborators Sep 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants