Skip to content

Commit

Permalink
Actions now can be passed without callback defined
Browse files Browse the repository at this point in the history
  • Loading branch information
igorprado committed Oct 15, 2015
1 parent d0c3675 commit 10a4ec2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/notification-system.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 10a4ec2

Please sign in to comment.