test(platform): iOS from iPod user agent

This commit is contained in:
Adam Bradley
2015-01-09 08:54:22 -06:00
parent b8112aba2a
commit d24ac308c3
2 changed files with 9 additions and 1 deletions

View File

@@ -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);