Skip to content

Commit

Permalink
Added tests for bulk destroy messages
Browse files Browse the repository at this point in the history
  • Loading branch information
flippinjoe committed Jun 17, 2015
1 parent a6db2cd commit 66dc13b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/growlFactoryTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,25 @@ describe("growlFactory Spec", function() {
}
});

it('Should add and return an info message', function () {
it('Should add and remove 1 message', function () {
var msg = growlFactory.info('text');

expect(growlMessages.getAllMessages().length).toEqual(1);
msg.destroy();
expect(growlMessages.getAllMessages().length).toEqual(0);
});

it('Should be able to destroy all messages', function () {
var messageCount = 10;
for (var i = 0; i < messageCount; i++) {
growlFactory.info('Test ' + i);
}

expect(growlMessages.getAllMessages().length).toEqual(messageCount);

growlMessages.destroyAllMessages();

expect(growlMessages.getAllMessages().length).toEqual(0);

})
});

0 comments on commit 66dc13b

Please sign in to comment.