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

New tests for instagram IAB #2691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/browser/src/tests/browser.test.ts
Expand Up @@ -180,6 +180,15 @@ describe('Browser', () => {
});
});

describe('isSafari', () => {
it('returns false with instagram in-app browser on android', () => {
const userAgent =
'Mozilla/5.0 (Linux; Android 13; Pixel 5a Build/TQ3A.230805.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36 Instagram 304.0.0.32.106 Android (33/13; 420dpi; 1080x2201; Google/google; Pixel 5a; barbet; barbet; en_US; 524768286)';

expect(new Browser({userAgent}).isSafari).toBe(false);
});
});

describe('isAndroid', () => {
it('returns true with a standard Android Chrome browser', () => {
const userAgent =
Expand All @@ -201,6 +210,13 @@ describe('Browser', () => {

expect(new Browser({userAgent}).isAndroid).toBe(false);
});

it('returns true with instagram in-app browser on android', () => {
const userAgent =
'Mozilla/5.0 (Linux; Android 13; Pixel 5a Build/TQ3A.230805.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36 Instagram 304.0.0.32.106 Android (33/13; 420dpi; 1080x2201; Google/google; Pixel 5a; barbet; barbet; en_US; 524768286)';

expect(new Browser({userAgent}).isAndroid).toBe(true);
});
});

describe('asPlainObject', () => {
Expand Down