11/* global sinon */
22
33import React , { Component } from 'react' ;
4- import TestUtils from 'react-addons- test-utils' ;
4+ import TestUtils from 'react-dom/ test-utils' ;
55import expect from 'expect' ;
66import NotificationSystem from 'NotificationSystem' ;
77import { positions , levels } from 'constants' ;
@@ -56,12 +56,12 @@ describe('Notification Component', function() {
5656
5757 it ( 'should be rendered' , done => {
5858 component = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notifications-wrapper' ) ;
59- expect ( component ) . toExist ( ) ;
59+ expect ( component ) . not . toBeNull ( ) ;
6060 done ( ) ;
6161 } ) ;
6262
6363 it ( 'should hold the component ref' , done => {
64- expect ( component ) . toExist ( ) ;
64+ expect ( component ) . not . toBeNull ( ) ;
6565 done ( ) ;
6666 } ) ;
6767
@@ -75,8 +75,8 @@ describe('Notification Component', function() {
7575 it ( 'should not set a notification visibility class when the notification is initially added' , done => {
7676 component . addNotification ( defaultNotification ) ;
7777 let notification = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notification' ) ;
78- expect ( notification . className ) . toNotMatch ( / n o t i f i c a t i o n - h i d d e n / ) ;
79- expect ( notification . className ) . toNotMatch ( / n o t i f i c a t i o n - v i s i b l e / ) ;
78+ expect ( notification . className ) . not . toMatch ( / n o t i f i c a t i o n - h i d d e n / ) ;
79+ expect ( notification . className ) . not . toMatch ( / n o t i f i c a t i o n - v i s i b l e / ) ;
8080 done ( ) ;
8181 } ) ;
8282
@@ -109,7 +109,7 @@ describe('Notification Component', function() {
109109 containers . forEach ( function ( container ) {
110110 for ( let level of Object . keys ( levels ) ) {
111111 let notification = container . getElementsByClassName ( 'notification-' + levels [ level ] ) ;
112- expect ( notification ) . toExist ( ) ;
112+ expect ( notification ) . not . toBeNull ( ) ;
113113 }
114114 } ) ;
115115
@@ -249,7 +249,7 @@ describe('Notification Component', function() {
249249 let notification = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notification' ) ;
250250 TestUtils . Simulate . click ( notification ) ;
251251 let notificationAfterClicked = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notification' ) ;
252- expect ( notificationAfterClicked ) . toExist ( ) ;
252+ expect ( notificationAfterClicked ) . not . toBeNull ( ) ;
253253 done ( ) ;
254254 } ) ;
255255
@@ -261,7 +261,7 @@ describe('Notification Component', function() {
261261
262262 component . addNotification ( defaultNotification ) ;
263263 let button = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notification-action-button' ) ;
264- expect ( button ) . toExist ( ) ;
264+ expect ( button ) . not . toBeNull ( ) ;
265265 done ( ) ;
266266 } ) ;
267267
@@ -325,7 +325,7 @@ describe('Notification Component', function() {
325325
326326 component . addNotification ( defaultNotification ) ;
327327 let customContainer = TestUtils . findRenderedDOMComponentWithClass ( instance , 'custom-container' ) ;
328- expect ( customContainer ) . toExist ( ) ;
328+ expect ( customContainer ) . not . toBeNull ( ) ;
329329 done ( ) ;
330330 } ) ;
331331
@@ -336,7 +336,7 @@ describe('Notification Component', function() {
336336 TestUtils . Simulate . mouseEnter ( notification ) ;
337337 clock . tick ( 4000 ) ;
338338 let _notification = TestUtils . findRenderedDOMComponentWithClass ( instance , 'notification' ) ;
339- expect ( _notification ) . toExist ( ) ;
339+ expect ( _notification ) . not . toBeNull ( ) ;
340340 done ( ) ;
341341 } ) ;
342342
0 commit comments