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

fix(navigator): check for experimental userAgentData first #1548

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Sep 9, 2022

Summary

https://algolia.atlassian.net/browse/CRAW-2433

Proposed in #1483 by @bershanskiy, moved here to add tests on top

This addition prevents the console warning when trying to detect the platform. We still fallback on the default navigator implementation if not found.

@shortcuts shortcuts self-assigned this Sep 9, 2022
@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for docsearch ready!

Name Link
🔨 Latest commit a90cdb8
🔍 Latest deploy log https://app.netlify.com/sites/docsearch/deploys/636a0c15b9775200080e4f40
😎 Deploy Preview https://deploy-preview-1548--docsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

.eslintrc.js Show resolved Hide resolved
Comment on lines +147 to +148
expect((navigator as any).userAgentData).not.be.undefined;
expect(navigator.platform).not.to.be.undefined;
Copy link
Member

Choose a reason for hiding this comment

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

This is testing the Chrome platform, not DocSearch. Why would we test this?

packages/docsearch-react/src/__tests__/api.test.tsx Outdated Show resolved Hide resolved
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