Skip to content

Commit

Permalink
feat(RTL): Update to new carousel classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Dec 14, 2020
1 parent bd6dcf7 commit db5993b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export interface CarouselProps
activeIndex?: number;
onSelect?: (eventKey: number, event: Record<string, unknown> | null) => void;
defaultActiveIndex?: number;
onSlide?: (eventKey: number, direction: 'left' | 'right') => void;
onSlid?: (eventKey: number, direction: 'left' | 'right') => void;
onSlide?: (eventKey: number, direction: 'start' | 'end') => void;
onSlid?: (eventKey: number, direction: 'start' | 'end') => void;
interval?: number | null;
keyboard?: boolean;
pause?: 'hover' | false;
Expand Down Expand Up @@ -352,7 +352,7 @@ function CarouselFunc(uncontrolledProps: CarouselProps, ref) {
}
});

const slideDirection = direction === 'next' ? 'left' : 'right';
const slideDirection = direction === 'next' ? 'start' : 'end';

useUpdateEffect(() => {
if (slide) {
Expand Down
4 changes: 2 additions & 2 deletions test/CarouselSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('<Carousel>', () => {
it(`should call ${eventName} with previous index and direction`, (done) => {
function onEvent(index, direction) {
expect(index).to.equal(0);
expect(direction).to.equal('right');
expect(direction).to.equal('end');

done();
}
Expand All @@ -130,7 +130,7 @@ describe('<Carousel>', () => {
function onEvent(index, direction) {
const lastPossibleIndex = items.length - 1;
expect(index).to.equal(lastPossibleIndex);
expect(direction).to.equal('left');
expect(direction).to.equal('start');

done();
}
Expand Down

0 comments on commit db5993b

Please sign in to comment.