File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ describe('Carousel', () => {
109
109
110
110
it ( 'should wrap around from the last to first slide if infinite is true and next is clicked' , done => {
111
111
const onSlideTransitionedStub = sinon . stub ( ) ;
112
+ const beforeChangeStub = sinon . stub ( ) ;
112
113
113
114
renderToJsdom (
114
115
< Carousel initialSlide = { 2 }
115
116
slideWidth = '300px'
116
117
viewportWidth = '300px'
117
118
infinite = { true }
118
- onSlideTransitioned = { onSlideTransitionedStub } >
119
+ onSlideTransitioned = { onSlideTransitionedStub }
120
+ beforeChange = { beforeChangeStub } >
119
121
< div id = 'slide1' />
120
122
< div id = 'slide2' />
121
123
< div id = 'slide3' />
@@ -136,6 +138,7 @@ describe('Carousel', () => {
136
138
index : 0 ,
137
139
direction : 'right'
138
140
} ) ;
141
+ expect ( beforeChangeStub ) . to . have . been . calledWith ( 0 , 2 , 'right' ) ;
139
142
done ( ) ;
140
143
} ) ;
141
144
} ) ;
You can’t perform that action at this time.
0 commit comments