mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(platform): iOS from iPod user agent
This commit is contained in:
@@ -86,6 +86,14 @@ describe('Ionic Platform Service', function() {
|
||||
expect(ionic.Platform.version()).toEqual(7.0);
|
||||
});
|
||||
|
||||
it('set ios with iPod user agent', function() {
|
||||
ionic.Platform.ua = 'Mozilla/5.0 (iPod touch; CPU OS 8_1_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53';
|
||||
ionic.Platform.setPlatform(undefined);
|
||||
ionic.Platform.setVersion(undefined);
|
||||
expect(ionic.Platform.platform()).toEqual('ios');
|
||||
expect(ionic.Platform.version()).toEqual(8.1);
|
||||
});
|
||||
|
||||
it('should not be iPad from none iPad user agent', function() {
|
||||
ionic.Platform.ua = 'Mozilla/5.0 (iPhone; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53';
|
||||
ionic.Platform.setPlatform(undefined);
|
||||
|
||||
Reference in New Issue
Block a user