From 0037283c7542337283d3ce3cd89a6c9a18ee3541 Mon Sep 17 00:00:00 2001 From: perploug Date: Thu, 12 Sep 2013 14:40:07 +0200 Subject: [PATCH] Adds a notifications test --- .../test/unit/common/services/notifications.spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/notifications.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/notifications.spec.js index c5ef819277..d2ac8f914b 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/common/services/notifications.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/notifications.spec.js @@ -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);