@@ -108,6 +108,78 @@ describe('Ionic Platform Service', function() {
108
108
expect ( ionic . Platform . platforms [ 3 ] ) . toEqual ( 'android4_2' ) ;
109
109
} ) ;
110
110
111
+ it ( 'sets grade a from iOS7' , function ( ) {
112
+ window . cordova = { } ;
113
+ ionic . Platform . setPlatform ( 'iOS' ) ;
114
+ ionic . Platform . setVersion ( '7.1.1' ) ;
115
+ ionic . Platform . _checkPlatforms ( )
116
+ expect ( ionic . Platform . grade ) . toEqual ( 'a' ) ;
117
+ } ) ;
118
+
119
+ it ( 'sets grade a from iOS6' , function ( ) {
120
+ window . cordova = { } ;
121
+ ionic . Platform . setPlatform ( 'iOS' ) ;
122
+ ionic . Platform . setVersion ( '6.1.1' ) ;
123
+ ionic . Platform . _checkPlatforms ( )
124
+ expect ( ionic . Platform . grade ) . toEqual ( 'a' ) ;
125
+ } ) ;
126
+
127
+ it ( 'sets grade a from Android 4.4' , function ( ) {
128
+ window . cordova = { } ;
129
+ ionic . Platform . setPlatform ( 'android' ) ;
130
+ ionic . Platform . setVersion ( '4.4.1' ) ;
131
+ ionic . Platform . _checkPlatforms ( )
132
+ expect ( ionic . Platform . grade ) . toEqual ( 'a' ) ;
133
+ } ) ;
134
+
135
+ it ( 'sets grade b from Android 4.3' , function ( ) {
136
+ window . cordova = { } ;
137
+ ionic . Platform . setPlatform ( 'android' ) ;
138
+ ionic . Platform . setVersion ( '4.3.1' ) ;
139
+ ionic . Platform . _checkPlatforms ( )
140
+ expect ( ionic . Platform . grade ) . toEqual ( 'b' ) ;
141
+ } ) ;
142
+
143
+ it ( 'sets grade b from Android 4.0' , function ( ) {
144
+ window . cordova = { } ;
145
+ ionic . Platform . setPlatform ( 'android' ) ;
146
+ ionic . Platform . setVersion ( '4.0.0' ) ;
147
+ ionic . Platform . _checkPlatforms ( )
148
+ expect ( ionic . Platform . grade ) . toEqual ( 'b' ) ;
149
+ } ) ;
150
+
151
+ it ( 'sets grade c from Android 3.0' , function ( ) {
152
+ window . cordova = { } ;
153
+ ionic . Platform . setPlatform ( 'android' ) ;
154
+ ionic . Platform . setVersion ( '3.0.0' ) ;
155
+ ionic . Platform . _checkPlatforms ( )
156
+ expect ( ionic . Platform . grade ) . toEqual ( 'c' ) ;
157
+ } ) ;
158
+
159
+ it ( 'sets grade c from Android 2.3.4' , function ( ) {
160
+ window . cordova = { } ;
161
+ ionic . Platform . setPlatform ( 'android' ) ;
162
+ ionic . Platform . setVersion ( '2.3.4' ) ;
163
+ ionic . Platform . _checkPlatforms ( )
164
+ expect ( ionic . Platform . grade ) . toEqual ( 'c' ) ;
165
+ } ) ;
166
+
167
+ it ( 'sets grade a from unknown android version' , function ( ) {
168
+ window . cordova = { } ;
169
+ ionic . Platform . setPlatform ( 'android' ) ;
170
+ ionic . Platform . setVersion ( '0' ) ;
171
+ ionic . Platform . _checkPlatforms ( )
172
+ expect ( ionic . Platform . grade ) . toEqual ( 'a' ) ;
173
+ } ) ;
174
+
175
+ it ( 'sets grade a from unknown platform' , function ( ) {
176
+ window . cordova = { } ;
177
+ ionic . Platform . setPlatform ( 'whatever' ) ;
178
+ ionic . Platform . setVersion ( '20.3.4' ) ;
179
+ ionic . Platform . _checkPlatforms ( )
180
+ expect ( ionic . Platform . grade ) . toEqual ( 'a' ) ;
181
+ } ) ;
182
+
111
183
it ( 'is android' , function ( ) {
112
184
ionic . Platform . setPlatform ( 'AnDrOiD' ) ;
113
185
expect ( ionic . Platform . is ( 'android' ) ) . toEqual ( true ) ;
0 commit comments