mirror of
https://github.com/moparisthebest/mail
synced 2025-02-27 08:11:44 -05:00
add check for folders present to unit test
This commit is contained in:
parent
5ddddb5568
commit
4a9b58cfe2
@ -58,7 +58,9 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should init', function(done) {
|
it('should init', function(done) {
|
||||||
var loginStub, listFolderStub;
|
var loginStub, listFolderStub, folders;
|
||||||
|
|
||||||
|
folders = [];
|
||||||
|
|
||||||
// initKeychain
|
// initKeychain
|
||||||
devicestorageStub.init.withArgs(emailAddress).yields();
|
devicestorageStub.init.withArgs(emailAddress).yields();
|
||||||
@ -68,7 +70,7 @@ define(function(require) {
|
|||||||
loginStub = sinon.stub(dao, '_imapLogin');
|
loginStub = sinon.stub(dao, '_imapLogin');
|
||||||
listFolderStub = sinon.stub(dao, '_imapListFolders');
|
listFolderStub = sinon.stub(dao, '_imapListFolders');
|
||||||
loginStub.yields();
|
loginStub.yields();
|
||||||
listFolderStub.yields();
|
listFolderStub.yields(null, folders);
|
||||||
|
|
||||||
dao.init({
|
dao.init({
|
||||||
account: account
|
account: account
|
||||||
@ -77,6 +79,7 @@ define(function(require) {
|
|||||||
expect(keyPair).to.equal(mockKeyPair);
|
expect(keyPair).to.equal(mockKeyPair);
|
||||||
|
|
||||||
expect(dao._account).to.equal(account);
|
expect(dao._account).to.equal(account);
|
||||||
|
expect(dao._account.folders).to.equal(folders);
|
||||||
expect(devicestorageStub.init.calledOnce).to.be.true;
|
expect(devicestorageStub.init.calledOnce).to.be.true;
|
||||||
expect(keychainStub.getUserKeyPair.calledOnce).to.be.true;
|
expect(keychainStub.getUserKeyPair.calledOnce).to.be.true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user