1+ import expect from "expect" ;
12import React from "react" ;
23import { findDOMNode , render , unmountComponentAtNode } from "react-dom" ;
34import { Scrollbar } from "react-scrollbars-custom" ;
@@ -17,41 +18,41 @@ export default function createTests(scrollbarWidth) {
1718 describe ( "when <Scrollbar /> is rendered" , function ( ) {
1819 it ( "renders content wrapper" , ( done ) => {
1920 render ( < Scrollbar /> , node , function ( ) {
20- expect ( this . wrapper ) . to . be . an . instanceof ( Node ) ;
21+ expect ( this . wrapper ) . toBeInstanceOf ( Node ) ;
2122
2223 done ( ) ;
2324 } ) ;
2425 } ) ;
2526 it ( "renders content" , ( done ) => {
2627 render ( < Scrollbar /> , node , function ( ) {
27- expect ( this . content ) . to . be . an . instanceof ( Node ) ;
28+ expect ( this . content ) . toBeInstanceOf ( Node ) ;
2829
2930 done ( ) ;
3031 } ) ;
3132 } ) ;
3233 it ( "content should have an absolute positioning" , ( done ) => {
3334 render ( < Scrollbar /> , node , function ( ) {
34- expect ( this . content . style . position ) . to . be . equal ( "absolute" ) ;
35- expect ( this . content . style . top ) . to . be . equal ( "0px" ) ;
36- expect ( this . content . style . left ) . to . be . equal ( "0px" ) ;
37- expect ( this . content . style . right ) . to . be . equal ( "0px" ) ;
38- expect ( this . content . style . bottom ) . to . be . equal ( "0px" ) ;
35+ expect ( this . content . style . position ) . toBe ( "absolute" ) ;
36+ expect ( this . content . style . top ) . toBe ( "0px" ) ;
37+ expect ( this . content . style . left ) . toBe ( "0px" ) ;
38+ expect ( this . content . style . right ) . toBe ( "0px" ) ;
39+ expect ( this . content . style . bottom ) . toBe ( "0px" ) ;
3940
4041 done ( ) ;
4142 } ) ;
4243 } ) ;
4344 it ( "renders tracks" , ( done ) => {
4445 render ( < Scrollbar /> , node , function ( ) {
45- expect ( this . trackVertical ) . to . be . an . instanceof ( Node ) ;
46- expect ( this . trackHorizontal ) . to . be . an . instanceof ( Node ) ;
46+ expect ( this . trackVertical ) . toBeInstanceOf ( Node ) ;
47+ expect ( this . trackHorizontal ) . toBeInstanceOf ( Node ) ;
4748
4849 done ( ) ;
4950 } ) ;
5051 } ) ;
5152 it ( "renders thumbs" , ( done ) => {
5253 render ( < Scrollbar /> , node , function ( ) {
53- expect ( this . thumbVertical ) . to . be . an . instanceof ( Node ) ;
54- expect ( this . thumbHorizontal ) . to . be . an . instanceof ( Node ) ;
54+ expect ( this . thumbVertical ) . toBeInstanceOf ( Node ) ;
55+ expect ( this . thumbHorizontal ) . toBeInstanceOf ( Node ) ;
5556
5657 done ( ) ;
5758 } ) ;
@@ -64,8 +65,8 @@ export default function createTests(scrollbarWidth) {
6465 function ( ) {
6566 setTimeout ( ( ) => {
6667 // 92 / 200 * 92 = 42.32
67- expect ( this . thumbVertical . style . height ) . to . be . equal ( "43px" ) ;
68- expect ( this . thumbHorizontal . style . width ) . to . be . equal ( "43px" ) ;
68+ expect ( this . thumbVertical . style . height ) . toBe ( "43px" ) ;
69+ expect ( this . thumbHorizontal . style . width ) . toBe ( "43px" ) ;
6970
7071 done ( ) ;
7172 } , 50 ) ;
@@ -78,8 +79,8 @@ export default function createTests(scrollbarWidth) {
7879 node ,
7980 function ( ) {
8081 setTimeout ( ( ) => {
81- expect ( this . thumbVertical . style . height ) . to . be . equal ( "50px" ) ;
82- expect ( this . thumbHorizontal . style . width ) . to . be . equal ( "50px" ) ;
82+ expect ( this . thumbVertical . style . height ) . toBe ( "50px" ) ;
83+ expect ( this . thumbHorizontal . style . width ) . toBe ( "50px" ) ;
8384
8485 done ( ) ;
8586 } , 50 ) ;
@@ -92,7 +93,7 @@ export default function createTests(scrollbarWidth) {
9293 render ( < Scrollbar tagName = "label" /> ,
9394 node ,
9495 function ( ) {
95- expect ( findDOMNode ( this ) . tagName . toLowerCase ( ) ) . to . be . equal ( "label" ) ;
96+ expect ( findDOMNode ( this ) . tagName . toLowerCase ( ) ) . toBe ( "label" ) ;
9697
9798 done ( ) ;
9899 } ) ;
@@ -104,8 +105,8 @@ export default function createTests(scrollbarWidth) {
104105 render ( < Scrollbar style = { { maxWidth : "100%" } } /> ,
105106 node ,
106107 function ( ) {
107- expect ( findDOMNode ( this ) . style . maxWidth ) . to . be . equal ( "100%" ) ;
108- expect ( findDOMNode ( this ) . style . display ) . to . be . equal ( "grid" ) ;
108+ expect ( findDOMNode ( this ) . style . maxWidth ) . toBe ( "100%" ) ;
109+ expect ( findDOMNode ( this ) . style . display ) . toBe ( "grid" ) ;
109110
110111 done ( ) ;
111112 } ) ;
@@ -120,8 +121,8 @@ export default function createTests(scrollbarWidth) {
120121 node ,
121122 function ( ) {
122123 setTimeout ( ( ) => {
123- expect ( this . trackVertical . style . display ) . to . be . equal ( "none" ) ;
124- expect ( this . trackHorizontal . style . display ) . to . be . equal ( "none" ) ;
124+ expect ( this . trackVertical . style . display ) . toBe ( "none" ) ;
125+ expect ( this . trackHorizontal . style . display ) . toBe ( "none" ) ;
125126
126127 done ( ) ;
127128 } , 50 ) ;
@@ -135,8 +136,8 @@ export default function createTests(scrollbarWidth) {
135136 node ,
136137 function ( ) {
137138 setTimeout ( ( ) => {
138- expect ( this . trackVertical . style . display ) . to . not . be . equal ( "none" ) ;
139- expect ( this . trackHorizontal . style . display ) . to . not . be . equal ( "none" ) ;
139+ expect ( this . trackVertical . style . display ) . not . toBe ( "none" ) ;
140+ expect ( this . trackHorizontal . style . display ) . not . toBe ( "none" ) ;
140141
141142 done ( ) ;
142143 } , 50 ) ;
@@ -150,7 +151,7 @@ export default function createTests(scrollbarWidth) {
150151 node ,
151152 function ( ) {
152153 setTimeout ( ( ) => {
153- expect ( this . trackVertical . style . display ) . to . not . be . equal ( "none" ) ;
154+ expect ( this . trackVertical . style . display ) . not . toBe ( "none" ) ;
154155
155156 done ( ) ;
156157 } , 50 ) ;
@@ -164,7 +165,7 @@ export default function createTests(scrollbarWidth) {
164165 node ,
165166 function ( ) {
166167 setTimeout ( ( ) => {
167- expect ( this . trackHorizontal . style . display ) . to . not . be . equal ( "none" ) ;
168+ expect ( this . trackHorizontal . style . display ) . not . toBe ( "none" ) ;
168169
169170 done ( ) ;
170171 } , 50 ) ;
@@ -180,12 +181,12 @@ export default function createTests(scrollbarWidth) {
180181 node ,
181182 function ( ) {
182183 setTimeout ( ( ) => {
183- expect ( this . trackVertical . style . display ) . to . be . equal ( "none" ) ;
184- expect ( this . content . style . overflowY ) . to . be . equal ( "hidden" ) ;
185- expect ( this . content . style . marginRight ) . to . be . equal ( "" ) ;
186- expect ( this . trackHorizontal . style . display ) . to . not . be . equal ( "none" ) ;
187- expect ( this . content . style . overflowX ) . to . not . be . equal ( "hidden" ) ;
188- expect ( this . content . style . marginBottom ) . to . not . be . equal ( "" ) ;
184+ expect ( this . trackVertical . style . display ) . toBe ( "none" ) ;
185+ expect ( this . content . style . overflowY ) . toBe ( "hidden" ) ;
186+ expect ( this . content . style . marginRight ) . toBe ( "" ) ;
187+ expect ( this . trackHorizontal . style . display ) . not . toBe ( "none" ) ;
188+ expect ( this . content . style . overflowX ) . not . toBe ( "hidden" ) ;
189+ expect ( this . content . style . marginBottom ) . not . toBe ( "" ) ;
189190
190191 done ( ) ;
191192 } , 50 ) ;
@@ -201,12 +202,12 @@ export default function createTests(scrollbarWidth) {
201202 node ,
202203 function ( ) {
203204 setTimeout ( ( ) => {
204- expect ( this . trackVertical . style . display ) . to . not . be . equal ( "none" ) ;
205- expect ( this . content . style . overflowY ) . to . not . be . equal ( "hidden" ) ;
206- expect ( this . content . style . marginRight ) . to . not . be . equal ( "" ) ;
207- expect ( this . trackHorizontal . style . display ) . to . be . equal ( "none" ) ;
208- expect ( this . content . style . overflowX ) . to . be . equal ( "hidden" ) ;
209- expect ( this . content . style . marginBottom ) . to . be . equal ( "" ) ;
205+ expect ( this . trackVertical . style . display ) . not . toBe ( "none" ) ;
206+ expect ( this . content . style . overflowY ) . not . toBe ( "hidden" ) ;
207+ expect ( this . content . style . marginRight ) . not . toBe ( "" ) ;
208+ expect ( this . trackHorizontal . style . display ) . toBe ( "none" ) ;
209+ expect ( this . content . style . overflowX ) . toBe ( "hidden" ) ;
210+ expect ( this . content . style . marginBottom ) . toBe ( "" ) ;
210211
211212 done ( ) ;
212213 } , 50 ) ;
@@ -222,13 +223,13 @@ export default function createTests(scrollbarWidth) {
222223 node ,
223224 function ( ) {
224225 setTimeout ( ( ) => {
225- expect ( this . trackHorizontal . style . display ) . to . be . equal ( "none" ) ;
226- expect ( this . trackVertical . style . display ) . to . be . equal ( "none" ) ;
227- expect ( this . content . style . overflowX ) . to . be . equal ( "hidden" ) ;
228- expect ( this . content . style . overflowY ) . to . be . equal ( "hidden" ) ;
229- expect ( this . content . style . overflow ) . to . be . equal ( "hidden" ) ;
230- expect ( this . content . style . marginBottom ) . to . be . equal ( "" ) ;
231- expect ( this . content . style . marginRight ) . to . be . equal ( "" ) ;
226+ expect ( this . trackHorizontal . style . display ) . toBe ( "none" ) ;
227+ expect ( this . trackVertical . style . display ) . toBe ( "none" ) ;
228+ expect ( this . content . style . overflowX ) . toBe ( "hidden" ) ;
229+ expect ( this . content . style . overflowY ) . toBe ( "hidden" ) ;
230+ expect ( this . content . style . overflow ) . toBe ( "hidden" ) ;
231+ expect ( this . content . style . marginBottom ) . toBe ( "" ) ;
232+ expect ( this . content . style . marginRight ) . toBe ( "" ) ;
232233
233234 done ( ) ;
234235 } , 50 ) ;
0 commit comments