Skip to content

Commit

Permalink
test: Add onActivate test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jessy1092 committed Mar 1, 2016
1 parent 5879e67 commit 6c6b1c2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/textService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,26 @@ describe('Text Service', () => {
assert.equal(false, service.open);
});
});

context('when onActivate', () => {

let writeSpy;

beforeEach(() => {
writeSpy = sinon.spy(service, 'write');
service.handle = false;
});

it('should write the success response', () => {
let fakeMsg = {"seqNum": 12841, "method": "onActivate"}

service.handleRequest(fakeMsg);

let testResp = {"success": true, "seqNum": 12841};

assert.equal(true, service.handle);
assert.deepEqual(testResp, writeSpy.getCall(0).args[0]);
});
});
});
});

0 comments on commit 6c6b1c2

Please sign in to comment.