Skip to content

Instantly share code, notes, and snippets.

@neurosnap
Created December 16, 2016 17:45
Show Gist options
  • Save neurosnap/6e85a5f94836ee0c300c5f2e0792d17d to your computer and use it in GitHub Desktop.
Save neurosnap/6e85a5f94836ee0c300c5f2e0792d17d to your computer and use it in GitHub Desktop.
describe('getFolderCount', () => {
const getFolderCount = selectors.getFolderCount;
before(() => {
sinon.stub(selectors, 'getDisplayFolderProp');
sinon.stub(selectors, 'getFoldersHash');
sinon.stub(selectors, 'calcFolderCount');
sinon.stub(coreSelectors, 'getMailboxes');
sinon.stub(coreSelectors, 'getThreadIdsByFolder');
getFolderCount({}, {});
});
after(() => {
selectors.getDisplayFolderProp.restore();
selectors.calcFolderCount.restore();
selectors.getFoldersHash.restore();
coreSelectors.getMailboxes.restore();
coreSelectors.getThreadIdsByFolder.restore();
});
it('should call getDisplayFolderProp', () => {
expect(selectors.getDisplayFolderProp).to.have.been.called();
});
it('should call calcFolderCount', () => {
expect(selectors.calcFolderCount).to.have.been.called();
});
it('should call getFoldersHash', () => {
expect(selectors.getFoldersHash).to.have.been.called();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment