Skip to content

Commit 9bb49d8

Browse files
committed
test other way too
1 parent 49d1be5 commit 9bb49d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/unit/carousel.tests.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ describe('Carousel', () => {
109109

110110
it('should wrap around from the last to first slide if infinite is true and next is clicked', done => {
111111
const onSlideTransitionedStub = sinon.stub();
112+
const beforeChangeStub = sinon.stub();
112113

113114
renderToJsdom(
114115
<Carousel initialSlide={ 2 }
115116
slideWidth='300px'
116117
viewportWidth='300px'
117118
infinite={ true }
118-
onSlideTransitioned={ onSlideTransitionedStub }>
119+
onSlideTransitioned={ onSlideTransitionedStub }
120+
beforeChange={ beforeChangeStub }>
119121
<div id='slide1'/>
120122
<div id='slide2'/>
121123
<div id='slide3'/>
@@ -136,6 +138,7 @@ describe('Carousel', () => {
136138
index: 0,
137139
direction: 'right'
138140
});
141+
expect(beforeChangeStub).to.have.been.calledWith(0, 2, 'right');
139142
done();
140143
});
141144
});

0 commit comments

Comments
 (0)