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(platform): properly detect iPads running iPadOS #19258

Merged
merged 3 commits into from
Sep 12, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add better test
liamdebeasi committed Sep 3, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 77e715420fed12b77aa08f5edeafcf83189474fa
16 changes: 9 additions & 7 deletions core/src/utils/test/platform.spec.ts
Original file line number Diff line number Diff line change
@@ -42,13 +42,6 @@ describe('Platform Tests', () => {
const win = configureBrowser(PlatformConfiguration.Capacitor);
expect(getPlatforms(win)).toContain('capacitor');
})

it('should contain "mobile", "ipad", and "ios" platform', () => {
const win = configureBrowser(PlatformConfiguration.iPadOS);
expect(getPlatforms(win)).toContain('mobile');
expect(getPlatforms(win)).toContain('ipad');
expect(getPlatforms(win)).toContain('ios');
})
});

describe('isPlatform()', () => {
@@ -129,5 +122,14 @@ describe('Platform Tests', () => {
expect(isPlatform(win, 'pwa')).toEqual(true);
expect(isPlatform(win, 'cordova')).toEqual(false);
});

it('should return true for "ios", "ipad", and "tablet" and false for "iphone" and "android"', () => {
const win = configureBrowser(PlatformConfiguration.iPadOS);
expect(isPlatform(win, 'ios')).toEqual(true);
expect(isPlatform(win, 'ipad')).toEqual(true);
expect(isPlatform(win, 'tablet')).toEqual(true);
expect(isPlatform(win, 'iphone')).toEqual(false);
expect(isPlatform(win, 'android')).toEqual(false);
});
})
});