@@ -363,6 +363,37 @@ describe('Platform', () => {
363363 expect ( plt . is ( 'tablet' ) ) . toEqual ( true ) ;
364364 } ) ;
365365
366+ // for https://forums.developer.apple.com/thread/25948
367+ it ( 'should set ipad when user agent is iphone but navigator.platform is iPad' , ( ) => {
368+ plt . setQueryParams ( '' ) ;
369+ plt . setUserAgent ( IPHONE_UA ) ;
370+ plt . setNavigatorPlatform ( 'iPad' ) ;
371+ plt . init ( ) ;
372+
373+ expect ( plt . is ( 'core' ) ) . toEqual ( false ) ;
374+ expect ( plt . is ( 'mobile' ) ) . toEqual ( true ) ;
375+ expect ( plt . is ( 'windows' ) ) . toEqual ( false ) ;
376+ expect ( plt . is ( 'android' ) ) . toEqual ( false ) ;
377+ expect ( plt . is ( 'ios' ) ) . toEqual ( true ) ;
378+ expect ( plt . is ( 'ipad' ) ) . toEqual ( true ) ;
379+ expect ( plt . is ( 'iphone' ) ) . toEqual ( false ) ;
380+ expect ( plt . is ( 'tablet' ) ) . toEqual ( true ) ;
381+
382+ plt . setQueryParams ( '' ) ;
383+ plt . setUserAgent ( IPHONE_10_2_UA ) ;
384+ plt . setNavigatorPlatform ( 'iPad' ) ;
385+ plt . init ( ) ;
386+
387+ expect ( plt . is ( 'core' ) ) . toEqual ( false ) ;
388+ expect ( plt . is ( 'mobile' ) ) . toEqual ( true ) ;
389+ expect ( plt . is ( 'windows' ) ) . toEqual ( false ) ;
390+ expect ( plt . is ( 'android' ) ) . toEqual ( false ) ;
391+ expect ( plt . is ( 'ios' ) ) . toEqual ( true ) ;
392+ expect ( plt . is ( 'ipad' ) ) . toEqual ( true ) ;
393+ expect ( plt . is ( 'iphone' ) ) . toEqual ( false ) ;
394+ expect ( plt . is ( 'tablet' ) ) . toEqual ( true ) ;
395+ } ) ;
396+
366397 it ( 'should set core platform for osx desktop firefox' , ( ) => {
367398 plt . setQueryParams ( '' ) ;
368399 plt . setDefault ( 'core' ) ;
0 commit comments