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

ATS-analytics - fix check for safari browser #5474

Merged
merged 7 commits into from
Jul 16, 2020

Conversation

mamatic
Copy link
Contributor

@mamatic mamatic commented Jul 9, 2020

Type of change

  • Bugfix

Description of change

Safari is reporting a value of “false” for userBrowser in ATS Analytics.

Other information

@bretg

Copy link
Collaborator

@bretg bretg left a comment

Choose a reason for hiding this comment

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

please add a unit test

@lgtm-com
Copy link

lgtm-com bot commented Jul 13, 2020

This pull request introduces 1 alert when merging 9d3b306 into a2ec9c2 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@mamatic mamatic requested a review from bretg July 14, 2020 06:57
@@ -2,7 +2,7 @@ import atsAnalyticsAdapter from '../../../modules/atsAnalyticsAdapter.js';
import { expect } from 'chai';
import adapterManager from 'src/adapterManager.js';
import {server} from '../../mocks/xhr.js';
import {browserIsChrome, browserIsEdge, browserIsFirefox, browserIsSafari} from '../../../modules/atsAnalyticsAdapter.js';
import {checkUserBrowser, browserIsChrome, browserIsEdge, browserIsSafari} from '../../../modules/atsAnalyticsAdapter.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason for not testing browserIsFirefox()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, yes, I didn't manage to mock InstallTrigger. We use this check to determine if user browser is firefox
(typeof InstallTrigger !== 'undefined').

https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger
https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser/9851769

@mamatic
Copy link
Contributor Author

mamatic commented Jul 15, 2020

Hi @bretg,
I manage to write tests for Firefox. Manage to mock InstallTrigger. After a little research, global.InstallTrigger do a job.

@bretg bretg merged commit dbfa543 into prebid:master Jul 16, 2020
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