From 4a9b58cfe2c20a63c8a3922a5bd7d54a36f877c9 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Fri, 29 Nov 2013 16:13:18 +0100 Subject: [PATCH] add check for folders present to unit test --- test/new-unit/email-dao-2-test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/new-unit/email-dao-2-test.js b/test/new-unit/email-dao-2-test.js index f842a14..b322c45 100644 --- a/test/new-unit/email-dao-2-test.js +++ b/test/new-unit/email-dao-2-test.js @@ -58,7 +58,9 @@ define(function(require) { }); it('should init', function(done) { - var loginStub, listFolderStub; + var loginStub, listFolderStub, folders; + + folders = []; // initKeychain devicestorageStub.init.withArgs(emailAddress).yields(); @@ -68,7 +70,7 @@ define(function(require) { loginStub = sinon.stub(dao, '_imapLogin'); listFolderStub = sinon.stub(dao, '_imapListFolders'); loginStub.yields(); - listFolderStub.yields(); + listFolderStub.yields(null, folders); dao.init({ account: account @@ -77,6 +79,7 @@ define(function(require) { expect(keyPair).to.equal(mockKeyPair); expect(dao._account).to.equal(account); + expect(dao._account.folders).to.equal(folders); expect(devicestorageStub.init.calledOnce).to.be.true; expect(keychainStub.getUserKeyPair.calledOnce).to.be.true;