Skip to content

Commit

Permalink
Merge branch 'release/0.2.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
igorprado committed Mar 2, 2017
2 parents 944d2f8 + 0f9d27a commit 9aed3c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.2.12 - Mar 01, 2017

* Adds support for enter and exit animations for NotificationItem. (thanks to @OriR)

## 0.2.11 - Dec 06, 2016

* Added `clearNotifications()` method (thanks to @saaqibz)
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-notification-system",
"version": "0.2.11",
"version": "0.2.12",
"description": "A React Notification System fully customized",
"main": "dist/NotificationSystem.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/NotificationItem.jsx
Expand Up @@ -48,7 +48,7 @@ var NotificationItem = React.createClass({

getInitialState: function() {
return {
visible: false,
visible: undefined,
removed: false
};
},
Expand Down Expand Up @@ -250,7 +250,7 @@ var NotificationItem = React.createClass({

if (this.state.visible) {
className += ' notification-visible';
} else {
} else if (this.state.visible === false) {
className += ' notification-hidden';
}

Expand Down
12 changes: 10 additions & 2 deletions test/notification-system.test.js
Expand Up @@ -72,10 +72,18 @@ describe('Notification Component', function() {
done();
});

it('should set the notification class from hidden to visible after added', done => {
it('should not set a notification visibility class when the notification is initially added', done => {
component.addNotification(defaultNotification);
let notification = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
expect(notification.className).toMatch(/notification-hidden/);
expect(notification.className).toNotMatch(/notification-hidden/);
expect(notification.className).toNotMatch(/notification-visible/);
done();
});

it('should set the notification class to visible after added', done => {
component.addNotification(defaultNotification);
let notification = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
expect(notification.className).toMatch(/notification/);
clock.tick(400);
expect(notification.className).toMatch(/notification-visible/);
done();
Expand Down

0 comments on commit 9aed3c9

Please sign in to comment.