Skip to content

Commit

Permalink
fix(deps): update dependency react-slick to ^0.30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan2406 committed Apr 4, 2024
1 parent 54d4d53 commit 2047e8d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"react-datepicker": "^4.25.0",
"react-popper": "^2.3.0",
"react-select": "^5.8.0",
"react-slick": "^0.29.0",
"react-slick": "^0.30.2",
"react-toastify": "^9.1.3",
"ryze": "^0.1.2",
"slick-carousel": "^1.8.1"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Carousel/Carousel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Default: Story = {
slidesToShow: 2,
variableWidth: false,
},
decorators: [(StoryIns) => <div style={{ display: 'block', width: '100%' }}>{StoryIns()}</div>],
decorators: [(StoryIns) => <div style={{ display: 'block', maxWidth: 680 }}>{StoryIns()}</div>],
};

export const usePreventSwipeClicks = {
Expand All @@ -61,5 +61,5 @@ export const usePreventSwipeClicks = {
slidesToShow: 2,
variableWidth: false,
},
decorators: [(StoryIns) => <div style={{ display: 'block', width: '100%' }}>{StoryIns()}</div>],
decorators: [(StoryIns) => <div style={{ display: 'block', maxWidth: 680 }}>{StoryIns()}</div>],
};
13 changes: 5 additions & 8 deletions src/components/Carousel/index.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ it('should render with defaults', () => {
it('should render with slides', () => {
render(
<Carousel>
<img data-testid="carousel-image-wrapper" src="path/to/image-1.jpg" alt="1" />
<img data-testid="carousel-image-wrapper" src="path/to/image-2.jpg" alt="2" />
<img data-testid="carousel-image" src="path/to/image-1.jpg" alt="1" />
<img data-testid="carousel-image" src="path/to/image-2.jpg" alt="2" />
</Carousel>
);
screen.getAllByTestId('carousel-image-wrapper').forEach((each) => {
expect(each).toBeInTheDocument();
});
screen.getAllByTestId('carousel-image-wrapper').forEach((each, index) => {
expect(each).toHaveAttribute('src', `path/to/image-${index + 1}.jpg`);
});
const [a, b] = screen.getAllByTestId('carousel-image');
expect(a).toHaveAttribute('src', 'path/to/image-1.jpg');
expect(b).toHaveAttribute('src', 'path/to/image-2.jpg');
});

it('should be able to navigate to the next image', async () => {
Expand Down

0 comments on commit 2047e8d

Please sign in to comment.