Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/browser/src/tests/browser.test.ts
Original file line number Diff line number Diff line change
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
Loading