@@ -99,13 +99,6 @@ describe('Lock', function () {
9999 sandbox . stub ( unlockHelpers , 'fingerprintUnlock' ) . onFirstCall ( ) ;
100100 await unlockWithOptions . bind ( driver ) ( { unlockType : 'fingerprint' , unlockKey : '1111' } ) ;
101101 } ) ;
102- it ( 'should throw an error is api is lower than 23 and trying to use fingerprintUnlock' , async function ( ) {
103- sandbox . stub ( driver . adb , 'isScreenLocked' ) . onCall ( 0 ) . returns ( true ) ;
104- sandbox . stub ( driver . adb , 'isLockManagementSupported' ) . onCall ( 0 ) . returns ( false ) ;
105- sandbox . stub ( driver . adb , 'getApiLevel' ) . onFirstCall ( ) . returns ( 21 ) ;
106- await unlockWithOptions . bind ( driver ) ( { unlockType : 'fingerprint' , unlockKey : '1111' } )
107- . should . be . rejectedWith ( 'Fingerprint' ) ;
108- } ) ;
109102 } ) ;
110103 describe ( 'validateUnlockCapabilities' , function ( ) {
111104 function toCaps ( unlockType , unlockKey ) {
@@ -178,13 +171,6 @@ describe('Lock', function () {
178171 sandbox . stub ( asyncboxHelpers , 'sleep' ) . withArgs ( UNLOCK_WAIT_TIME ) . onFirstCall ( ) ;
179172 await fingerprintUnlock . bind ( driver ) ( caps ) . should . be . fulfilled ;
180173 } ) ;
181- it ( 'should throw error if API level < 23' , async function ( ) {
182- sandbox . stub ( driver . adb , 'getApiLevel' ) . returns ( 22 ) ;
183- sandbox . stub ( driver . adb , 'fingerprint' ) . throws ( ) ;
184- sandbox . stub ( asyncboxHelpers , 'sleep' ) . throws ( ) ;
185- await fingerprintUnlock . bind ( driver ) ( { } )
186- . should . eventually . be . rejectedWith ( 'only works for Android 6+' ) ;
187- } ) ;
188174 } ) ;
189175 describe ( 'pinUnlock' , function ( ) {
190176 const caps = { unlockKey : '13579' } ;
@@ -223,28 +209,6 @@ describe('Lock', function () {
223209
224210 await pinUnlock . bind ( driver ) ( caps ) ;
225211
226- driver . click . getCall ( 0 ) . args [ 0 ] . should . equal ( 1 ) ;
227- driver . click . getCall ( 1 ) . args [ 0 ] . should . equal ( 3 ) ;
228- driver . click . getCall ( 2 ) . args [ 0 ] . should . equal ( 5 ) ;
229- driver . click . getCall ( 3 ) . args [ 0 ] . should . equal ( 7 ) ;
230- driver . click . getCall ( 4 ) . args [ 0 ] . should . equal ( 9 ) ;
231- } ) ;
232- it ( 'should be able to unlock device using pin (API level < 21)' , async function ( ) {
233- sandbox . stub ( driver . adb , 'dismissKeyguard' ) . onFirstCall ( ) ;
234- sandbox . stub ( unlockHelpers , 'stringKeyToArr' ) . returns ( keys ) ;
235- sandbox . stub ( driver . adb , 'getApiLevel' ) . returns ( 20 ) ;
236- const findElOrElsStub = sandbox . stub ( driver , 'findElOrEls' ) ;
237- for ( let pin of keys ) {
238- findElOrElsStub
239- . withArgs ( 'id' , `com.android.keyguard:id/key${ pin } ` , false )
240- . returns ( { ELEMENT : parseInt ( pin , 10 ) } ) ;
241- }
242- sandbox . stub ( driver . adb , 'isScreenLocked' ) . returns ( false ) ;
243- sandbox . stub ( asyncboxHelpers , 'sleep' ) . withArgs ( UNLOCK_WAIT_TIME ) . onFirstCall ( ) ;
244- sandbox . stub ( driver , 'click' ) ;
245-
246- await pinUnlock . bind ( driver ) ( caps ) ;
247-
248212 driver . click . getCall ( 0 ) . args [ 0 ] . should . equal ( 1 ) ;
249213 driver . click . getCall ( 1 ) . args [ 0 ] . should . equal ( 3 ) ;
250214 driver . click . getCall ( 2 ) . args [ 0 ] . should . equal ( 5 ) ;
0 commit comments