     expect(client).toBeDefined()
     expect(@$.Client).toHaveBeenCalledWith(pairingId)
     
-    expect(client.on.calls.count()).toBe(2)
+    expect(client.on.calls.count()).toBe(3)
     expect(client.on.calls.argsFor(0)[0]).toBe('m2fa.identify')
     expect(client.on.calls.argsFor(0)[1]).toEqual(jasmine.any(Function))
     expect(client.on.calls.argsFor(1)[0]).toBe('m2fa.challenge')

    tx =
      _out: {authorizationPaired: "XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx"}
    pairingId = "a_random_pairing_id"
    client = jasmine.createSpyObj('client',['on','off','sendChallenge','rejectPairing','confirmPairing','requestValidation'])
    spyOn(@$, '_getClientFor').and.returnValue(client)
    
    [c, r] = @$.validateTx(tx, pairingId)

    expect(r.constructor.name).toBe('Promise')

    expect(@$._getClientFor).toHaveBeenCalledWith(pairingId)
    expect(client.off.calls.count()).toBe(2)

  it "get call validateTx for each client on validateTxOnAll", ->
    tx =
      _out: {authorizationPaired: "XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx"}
    spyOn(@$, 'getPairingIds').and.returnValue(Q([{"a_random_pairing_id":"label"}]))
    spyOn(@$, 'validateTx').and.returnValue(Q())
    console.log(typeof ledger.api.M2faRestClient.instance)
    spyOn(ledger.api.M2faRestClient.instance, 'wakeUpSecureScreens')
    [c, r] = @$.validateTxOnAll(tx)
    expect(ledger.api.M2faRestClient.instance.wakeUpSecureScreens).toHaveBeenCalledWith(["a_random_pairing_id"])
    expect(@$.validateTx.calls.count()).toBe(1)
    expect(@$.validateTx.calls.argsFor(0)).toEqual([tx,"a_random_pairing_id"])

