Adds a notifications test

This commit is contained in:
perploug
2013-09-12 14:40:07 +02:00
parent 8c71195244
commit 0037283c75

View File

@@ -14,14 +14,17 @@ describe('notification tests', function () {
var not1 = notifications.success("success", "something great happened");
var not2 = notifications.error("error", "something great happened");
var not3 = notifications.warning("warning", "something great happened");
var not4 = notifications.warning("warning", "");
expect(notifications.getCurrent().length).toBe(3);
expect(notifications.getCurrent().length).toBe(4);
//remove at index 0
notifications.remove(0);
expect(notifications.getCurrent().length).toEqual(2);
expect(notifications.getCurrent()[0].headline).toBe("error");
expect(notifications.getCurrent().length).toEqual(3);
expect(notifications.getCurrent()[0].headline).toBe("error:");
expect(notifications.getCurrent()[1].headline).toBe("warning:");
expect(notifications.getCurrent()[2].headline).toBe("warning");
notifications.removeAll();
expect(notifications.getCurrent().length).toEqual(0);