reshaped 3.3.12 → 3.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +0,0 @@
1
- import { expect } from "@storybook/test";
2
- import Carousel from "../index.js";
3
- export default {
4
- title: "Components/Carousel/tests",
5
- component: Carousel,
6
- parameters: {
7
- iframe: {
8
- url: "https://reshaped.so/docs/components/carousel",
9
- },
10
- chromatic: { disableSnapshot: true },
11
- },
12
- };
13
- export const render = {
14
- name: "rendering",
15
- render: () => (<Carousel attributes={{ "data-testid": "test-id" }}>
16
- <div>Content</div>
17
- <div>Content</div>
18
- </Carousel>),
19
- play: async ({ canvas }) => {
20
- const elRoot = canvas.getByTestId("test-id");
21
- const elItems = canvas.getAllByText("Content");
22
- const elButtons = elRoot.querySelectorAll("button");
23
- expect(elRoot).toBeInTheDocument();
24
- expect(elRoot.tagName).toBe("SECTION");
25
- expect(elItems).toHaveLength(2);
26
- expect(elButtons).toHaveLength(2);
27
- },
28
- };
29
- export const navigationDisplay = {
30
- name: "navigationDisplay",
31
- render: () => (<Carousel navigationDisplay="hidden" attributes={{ "data-testid": "test-id" }}>
32
- <div>Content</div>
33
- </Carousel>),
34
- play: async ({ canvas }) => {
35
- const elRoot = canvas.getByTestId("test-id");
36
- const elButtons = elRoot.querySelectorAll("button");
37
- expect(elButtons).toHaveLength(0);
38
- },
39
- };
40
- export const className = {
41
- name: "className, attributes",
42
- render: () => (<div data-testid="root">
43
- <Carousel className="test-classname" attributes={{ id: "test-id" }}>
44
- <div>Content</div>
45
- </Carousel>
46
- </div>),
47
- play: async ({ canvas }) => {
48
- const root = canvas.getByTestId("root").firstChild;
49
- expect(root).toHaveClass("test-classname");
50
- expect(root).toHaveAttribute("id", "test-id");
51
- },
52
- };