Skip to content

Fix Saucelabs tests in analytics and functions #2845

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 5 commits into from
Apr 2, 2020
Merged

Conversation

hsubox76
Copy link
Contributor

Fix some failing IE tests in analytics and functions.
Also fixed error in workflow file so that cross-browser workflow will run again.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 31, 2020

Binary Size Report

Affected SDKs

SDKTypeBase (8e70e4a)Head (ae2f10f)Diff
@firebase/firestore/memorybrowser224475.00223866.00-609.00 (-0.27%)
module221655.00221046.00-609.00 (-0.27%)
esm2017170304.00169785.00-519.00 (-0.30%)
main397404.00396522.00-882.00 (-0.22%)
@firebase/firestorebrowser271055.00270246.00-809.00 (-0.30%)
module267834.00267025.00-809.00 (-0.30%)
esm2017216141.00215496.00-645.00 (-0.30%)
main488418.00487081.00-1337.00 (-0.27%)
firebasefirebase.js846872.00846074.00-798.00 (-0.09%)
firebase-firestore.memory.js266750.00266153.00-597.00 (-0.22%)
firebase-firestore.js311995.00311197.00-798.00 (-0.26%)
Metric Unit: byte

Test Logs

@@ -88,7 +88,8 @@ describe('FirebaseAnalytics instance tests', () => {
currency: 'USD'
});
// Clear event stack of async FID call.
await fidDeferred.promise;
// For IE: Need to wrap it in another function as FID fetch is wrapped in initializeGAId.
await (() => fidDeferred.promise);
Copy link
Member

@Feiyang1 Feiyang1 Apr 1, 2020

Choose a reason for hiding this comment

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

Does it really work? Do you mean to execute the function, (async () => fidDeferred.promise)()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did work but I don't know why, which seems bad. I changed it to something more readable but doesn't follow the logic as much. For some reason, only IE executes the expect assertions immediately after the mock FID promise resolves instead of executing the gtag config statements which should be first in line.

I also fixed another issue on the last test in index.test.ts where the config calls were resolving after the test was disposed of, which again seems to be IE only.

@hsubox76 hsubox76 merged commit 7b17e03 into master Apr 2, 2020
@hsubox76 hsubox76 deleted the ch-saucelabs branch April 3, 2020 18:54
@firebase firebase locked and limited conversation to collaborators May 3, 2020
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.

3 participants