From 10a4ec223f97d39d2219af5c1bfffff040531085 Mon Sep 17 00:00:00 2001 From: Igor Prado Date: Thu, 15 Oct 2015 20:12:58 -0300 Subject: [PATCH] Actions now can be passed without callback defined --- test/notification-system.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/notification-system.test.js b/test/notification-system.test.js index 2996757..e3aab6f 100644 --- a/test/notification-system.test.js +++ b/test/notification-system.test.js @@ -228,6 +228,19 @@ describe('Notification Component', function() { done(); }); + it('should accept an action without callback function defined', done => { + notificationObj.action = { + label: 'Click me' + }; + + component.addNotification(notificationObj); + let button = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification-action-button'); + TestUtils.Simulate.click(button); + let notification = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'notification'); + expect(notification.length).toEqual(0); + done(); + }); + it('should execute a callback function on add a notification', done => { let testThis = false; notificationObj.onAdd = function() {