@coopdigital/react 0.3.0 → 0.4.0
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.
- package/dist/components/Pill/Pill.d.ts +3 -10
- package/dist/components/Pill/Pill.js +5 -2
- package/package.json +7 -4
- package/src/components/Pill/Pill.tsx +9 -2
- package/dist/components/Button/Button.e2e.test.d.ts +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -4
- package/dist/components/Pill/Pill.e2e.test.d.ts +0 -1
- package/dist/components/Pill/Pill.test.d.ts +0 -4
- package/src/components/Button/Button.e2e.test.ts +0 -8
- package/src/components/Button/Button.stories.tsx +0 -13
- package/src/components/Button/Button.test.tsx +0 -18
- package/src/components/Pill/Pill.e2e.test.ts +0 -134
- package/src/components/Pill/Pill.stories.tsx +0 -138
- package/src/components/Pill/Pill.test.tsx +0 -25
- package/src/components/Pill/__snapshots__/Pill-default-Does-match-the-previous-screenshot.png +0 -0
- package/src/components/Pill/__snapshots__/Pill-with-badge-Does-match-the-previous-screenshot.png +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { AnchorHTMLAttributes, ForwardRefExoticComponent } from "react";
|
|
2
2
|
export interface PillProps {
|
|
3
|
+
as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string;
|
|
3
4
|
ariaLabel?: string;
|
|
4
5
|
badge?: string;
|
|
5
6
|
badgeColor?: "green" | "orange" | "red" | "pink";
|
|
@@ -9,13 +10,5 @@ export interface PillProps {
|
|
|
9
10
|
pillColor?: "blue" | "pink";
|
|
10
11
|
size?: "sm" | "md" | "lg" | "xl";
|
|
11
12
|
}
|
|
12
|
-
export declare const Pill: ({ ariaLabel, badge, badgeColor, children, className, href, pillColor, size, }: PillProps) => React.
|
|
13
|
-
"aria-label": string | undefined;
|
|
14
|
-
className: string;
|
|
15
|
-
"data-badge": string | undefined;
|
|
16
|
-
"data-badge-color": "green" | "orange" | "red" | "pink";
|
|
17
|
-
"data-pill-color": "pink" | "blue";
|
|
18
|
-
"data-size": "sm" | "lg" | "xl" | undefined;
|
|
19
|
-
href: string | undefined;
|
|
20
|
-
}, HTMLElement>;
|
|
13
|
+
export declare const Pill: ({ ariaLabel, as, badge, badgeColor, children, className, href, pillColor, size, }: PillProps) => React.ReactElement<React.AnchorHTMLAttributes<HTMLElement>, string | React.JSXElementConstructor<any>>;
|
|
21
14
|
export default Pill;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
const Pill = ({ ariaLabel, badge, badgeColor = "red", children, className = "", href, pillColor = "blue", size = "md", }) => {
|
|
4
|
-
|
|
3
|
+
const Pill = ({ ariaLabel, as, badge, badgeColor = "red", children, className = "", href, pillColor = "blue", size = "md", }) => {
|
|
4
|
+
let element = href ? "a" : "span";
|
|
5
|
+
if (as) {
|
|
6
|
+
element = as;
|
|
7
|
+
}
|
|
5
8
|
const componentProps = {
|
|
6
9
|
"aria-label": ariaLabel,
|
|
7
10
|
className: `coop-pill ${className}`,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"private": false,
|
|
7
7
|
"publishConfig": {
|
|
@@ -9,10 +9,13 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"src"
|
|
12
|
+
"src",
|
|
13
|
+
"!**/__{screenshots,tests}__",
|
|
14
|
+
"!**/*.{stories,test}.*"
|
|
13
15
|
],
|
|
14
16
|
"scripts": {
|
|
15
17
|
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest",
|
|
16
19
|
"test:coverage": "vitest run --coverage",
|
|
17
20
|
"build": "tsx scripts build",
|
|
18
21
|
"build:storybook": "storybook build --disable-telemetry && npm run storybook:fix-paths",
|
|
@@ -28,7 +31,7 @@
|
|
|
28
31
|
"devDependencies": {
|
|
29
32
|
"@axe-core/playwright": "^4.10.1",
|
|
30
33
|
"@chromatic-com/storybook": "^3.2.5",
|
|
31
|
-
"@coopdigital/styles": "^0.5.
|
|
34
|
+
"@coopdigital/styles": "^0.5.1",
|
|
32
35
|
"@playwright/test": "^1.50.1",
|
|
33
36
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
34
37
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
@@ -53,5 +56,5 @@
|
|
|
53
56
|
"react": "^19.0.0",
|
|
54
57
|
"react-dom": "^19.0.0"
|
|
55
58
|
},
|
|
56
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5f4108a06b915b2bd2c757bd713026e0710b0eb9"
|
|
57
60
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React, { AnchorHTMLAttributes, ForwardRefExoticComponent } from "react"
|
|
2
2
|
|
|
3
3
|
export interface PillProps {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
as?: React.FC<AnchorHTMLAttributes<HTMLElement>> | ForwardRefExoticComponent<any> | string
|
|
4
6
|
ariaLabel?: string
|
|
5
7
|
badge?: string
|
|
6
8
|
badgeColor?: "green" | "orange" | "red" | "pink"
|
|
@@ -13,6 +15,7 @@ export interface PillProps {
|
|
|
13
15
|
|
|
14
16
|
export const Pill = ({
|
|
15
17
|
ariaLabel,
|
|
18
|
+
as,
|
|
16
19
|
badge,
|
|
17
20
|
badgeColor = "red",
|
|
18
21
|
children,
|
|
@@ -21,7 +24,11 @@ export const Pill = ({
|
|
|
21
24
|
pillColor = "blue",
|
|
22
25
|
size = "md",
|
|
23
26
|
}: PillProps) => {
|
|
24
|
-
|
|
27
|
+
let element: PillProps["as"] = href ? "a" : "span"
|
|
28
|
+
|
|
29
|
+
if (as) {
|
|
30
|
+
element = as
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
const componentProps = {
|
|
27
34
|
"aria-label": ariaLabel,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "@playwright/test"
|
|
2
|
-
|
|
3
|
-
const server_url = "/iframe.html?viewMode=story&id=components-button--primary&args=&globals="
|
|
4
|
-
|
|
5
|
-
test("Add to basket button visibility", async ({ page }) => {
|
|
6
|
-
await page.goto(server_url)
|
|
7
|
-
await expect(page.getByRole("button", { name: "Add to basket" })).toBeVisible()
|
|
8
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
|
|
3
|
-
import Button from "./Button"
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Button> = {
|
|
6
|
-
component: Button,
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default meta
|
|
10
|
-
|
|
11
|
-
type Story = StoryObj<typeof meta>
|
|
12
|
-
|
|
13
|
-
export const Primary: Story = {}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @vitest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { render } from "@testing-library/react"
|
|
6
|
-
import { describe, it, afterEach } from "vitest"
|
|
7
|
-
import { Button } from "."
|
|
8
|
-
import { cleanup } from "@testing-library/react"
|
|
9
|
-
afterEach(() => {
|
|
10
|
-
cleanup()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
describe("Button", () => {
|
|
14
|
-
it("renders button", () => {
|
|
15
|
-
render(<Button />)
|
|
16
|
-
//screen.debug()
|
|
17
|
-
})
|
|
18
|
-
})
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "@playwright/test"
|
|
2
|
-
import AxeBuilder from "@axe-core/playwright"
|
|
3
|
-
|
|
4
|
-
const defaultUrl = "/iframe.html?globals=&args=&id=components-pill--default&viewMode=story"
|
|
5
|
-
const withoutLinkUrl = "/iframe.html?globals=&args=&id=components-pill--without-link&viewMode=story"
|
|
6
|
-
const withBadgeUrl = "/iframe.html?globals=&args=&id=components-pill--with-badge&viewMode=story"
|
|
7
|
-
|
|
8
|
-
test.describe("Pill default", () => {
|
|
9
|
-
test("Renders", async ({ page }) => {
|
|
10
|
-
await page.goto(defaultUrl)
|
|
11
|
-
const pill = page.getByRole("link", { name: "Be more Co-op" })
|
|
12
|
-
await expect(pill).toBeVisible()
|
|
13
|
-
await expect(pill).toHaveAttribute("href", "/be-more-co-op")
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
test("Does accept additional classes", async ({ page }) => {
|
|
17
|
-
await page.goto(defaultUrl + "&args=className:coop--uppercase")
|
|
18
|
-
const pill = page.getByRole("link", { name: "Be more Co-op" })
|
|
19
|
-
await expect(pill).toHaveClass(/coop-pill/)
|
|
20
|
-
await expect(pill).toHaveClass(/coop--uppercase/)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
test("Doesn't display new badge", async ({ page }) => {
|
|
24
|
-
await page.goto(defaultUrl)
|
|
25
|
-
const pill = page.getByRole("link", { name: "Be more Co-op" })
|
|
26
|
-
await expect(pill).not.toHaveAttribute("data-badge")
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test("Doesn't have any automatically detectable accessibility issues", async ({ page }) => {
|
|
30
|
-
await page.goto(defaultUrl)
|
|
31
|
-
|
|
32
|
-
await page.locator("#storybook-root").waitFor()
|
|
33
|
-
|
|
34
|
-
const accessibilityScanResults = await new AxeBuilder({ page })
|
|
35
|
-
.include("#storybook-root")
|
|
36
|
-
.analyze()
|
|
37
|
-
|
|
38
|
-
expect(accessibilityScanResults.violations).toEqual([])
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
test("Does match the previous screenshot", async ({ page }) => {
|
|
42
|
-
await page.goto(defaultUrl)
|
|
43
|
-
await expect(page).toHaveScreenshot()
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
test.describe("Pill with badge", () => {
|
|
48
|
-
test("Renders and has the badge", async ({ page }) => {
|
|
49
|
-
await page.goto(withBadgeUrl)
|
|
50
|
-
const pill = page.getByRole("link", { name: "Your weekly offers" })
|
|
51
|
-
await expect(pill).toBeVisible()
|
|
52
|
-
await expect(pill).toHaveAttribute("href", "/your-weekly-offers")
|
|
53
|
-
await expect(pill).toHaveAttribute("data-badge")
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
test("Doesn't have any automatically detectable accessibility issues", async ({ page }) => {
|
|
57
|
-
await page.goto(withBadgeUrl)
|
|
58
|
-
|
|
59
|
-
await page.locator("#storybook-root").waitFor()
|
|
60
|
-
|
|
61
|
-
const accessibilityScanResults = await new AxeBuilder({ page })
|
|
62
|
-
.include("#storybook-root")
|
|
63
|
-
.analyze()
|
|
64
|
-
|
|
65
|
-
expect(accessibilityScanResults.violations).toEqual([])
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
test("Does match the previous screenshot", async ({ page }) => {
|
|
69
|
-
await page.goto(withBadgeUrl)
|
|
70
|
-
await expect(page).toHaveScreenshot()
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
test.describe("Pill with or without href", () => {
|
|
75
|
-
test("Doesn't add a link when href is not provided", async ({ page }) => {
|
|
76
|
-
await page.goto(withoutLinkUrl)
|
|
77
|
-
const pill = page.locator("span.coop-pill")
|
|
78
|
-
await expect(pill).toBeVisible()
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
test("Renders a link when href is provided", async ({ page }) => {
|
|
82
|
-
await page.goto(withoutLinkUrl + "&args=href:test")
|
|
83
|
-
const pill = page.locator("a.coop-pill")
|
|
84
|
-
await expect(pill).toBeVisible()
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
test.describe("Pill size attribute", () => {
|
|
89
|
-
test("Doesn't apply data-size when size is 'md' (default)", async ({ page }) => {
|
|
90
|
-
await page.goto(defaultUrl + "&args=size:md")
|
|
91
|
-
const pill = page.locator(".coop-pill")
|
|
92
|
-
await expect(pill).not.toHaveAttribute("data-size")
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
test("Doesn't apply data-size when size is undefined", async ({ page }) => {
|
|
96
|
-
await page.goto(defaultUrl)
|
|
97
|
-
const pill = page.locator(".coop-pill")
|
|
98
|
-
await expect(pill).not.toHaveAttribute("data-size")
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
test("Does NOT apply data-size when size is an empty string", async ({ page }) => {
|
|
102
|
-
await page.goto(defaultUrl + "&args=size:")
|
|
103
|
-
const pill = page.locator(".coop-pill")
|
|
104
|
-
await expect(pill).not.toHaveAttribute("data-size")
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
test.describe("Pill badge color attribute", () => {
|
|
109
|
-
test("Applies data-badge-color when badgeColor is 'orange'", async ({ page }) => {
|
|
110
|
-
await page.goto(defaultUrl + "&args=badgeColor:orange")
|
|
111
|
-
const pill = page.locator(".coop-pill")
|
|
112
|
-
await expect(pill).toHaveAttribute("data-badge-color", "orange")
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
test("Applies default badge color when badgeColor is not provided", async ({ page }) => {
|
|
116
|
-
await page.goto(defaultUrl)
|
|
117
|
-
const pill = page.locator(".coop-pill")
|
|
118
|
-
await expect(pill).toHaveAttribute("data-badge-color", "red")
|
|
119
|
-
})
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
test.describe("Pill color attribute", () => {
|
|
123
|
-
test("Applies data-pill-color when pillColor is 'pink'", async ({ page }) => {
|
|
124
|
-
await page.goto(defaultUrl + "&args=pillColor:pink")
|
|
125
|
-
const pill = page.locator(".coop-pill")
|
|
126
|
-
await expect(pill).toHaveAttribute("data-pill-color", "pink")
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
test("Applies default pill color when pillColor is not provided", async ({ page }) => {
|
|
130
|
-
await page.goto(defaultUrl)
|
|
131
|
-
const pill = page.locator(".coop-pill")
|
|
132
|
-
await expect(pill).toHaveAttribute("data-pill-color", "blue")
|
|
133
|
-
})
|
|
134
|
-
})
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import "../../../../styles/src/components/Pill.scss"
|
|
3
|
-
|
|
4
|
-
import Pill from "./Pill"
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Pill> = {
|
|
7
|
-
component: Pill,
|
|
8
|
-
argTypes: {
|
|
9
|
-
href: {
|
|
10
|
-
description: "Specifies the URL that the Pill component will link to when clicked.",
|
|
11
|
-
},
|
|
12
|
-
children: {
|
|
13
|
-
description:
|
|
14
|
-
"Represents the content inside the Pill component. It can be any valid JSX or string.",
|
|
15
|
-
control: false,
|
|
16
|
-
},
|
|
17
|
-
className: {
|
|
18
|
-
description: "Receives any optional className to be applied to Pill component.",
|
|
19
|
-
},
|
|
20
|
-
badge: {
|
|
21
|
-
description: "Specifies what text Pill should display on the badge.",
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
description: "Specifies what should be the Pill size.",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
parameters: {
|
|
28
|
-
docs: {
|
|
29
|
-
description: {
|
|
30
|
-
component:
|
|
31
|
-
"The Pill component is a small, rounded label used to link and highlight information such as categories or articles. It can be customised with different content and styles to suit various use cases.",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
|
|
39
|
-
type Story = StoryObj<typeof meta>
|
|
40
|
-
|
|
41
|
-
export const Default: Story = {
|
|
42
|
-
args: { href: "/be-more-co-op", children: "Be more Co-op" },
|
|
43
|
-
parameters: {
|
|
44
|
-
docs: {
|
|
45
|
-
description: {
|
|
46
|
-
story: "Displays a basic Pill with default settings.",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const WithoutLink: Story = {
|
|
53
|
-
args: { children: "Be more Co-op" },
|
|
54
|
-
parameters: {
|
|
55
|
-
docs: {
|
|
56
|
-
description: {
|
|
57
|
-
story: "Displays a basic Pill as basic <span> element.",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const WithBadge: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
href: "/your-weekly-offers",
|
|
66
|
-
badge: "NEW",
|
|
67
|
-
children: "Your weekly offers",
|
|
68
|
-
},
|
|
69
|
-
parameters: {
|
|
70
|
-
docs: {
|
|
71
|
-
description: {
|
|
72
|
-
story: "Displays a Pill with an additional custom badge to indicate new content.",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const Sizes: Story = {
|
|
79
|
-
args: {
|
|
80
|
-
children: "Your weekly offers",
|
|
81
|
-
},
|
|
82
|
-
parameters: {
|
|
83
|
-
docs: {
|
|
84
|
-
description: {
|
|
85
|
-
story: "Displays all the 4 sizes supported.",
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
render: (args) => (
|
|
90
|
-
<>
|
|
91
|
-
<div className="coop-pill-group">
|
|
92
|
-
<Pill {...args} size="xl" />
|
|
93
|
-
<Pill {...args} size="lg" />
|
|
94
|
-
<Pill {...args} size="md" />
|
|
95
|
-
<Pill {...args} size="sm" />
|
|
96
|
-
</div>
|
|
97
|
-
<div className="coop-pill-group">
|
|
98
|
-
<Pill {...args} badge="NEW" size="xl" />
|
|
99
|
-
<Pill {...args} badge="NEW" size="lg" />
|
|
100
|
-
<Pill {...args} badge="NEW" size="md" />
|
|
101
|
-
<Pill {...args} badge="NEW" size="sm" />
|
|
102
|
-
</div>
|
|
103
|
-
</>
|
|
104
|
-
),
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const ColourVariations: Story = {
|
|
108
|
-
args: {
|
|
109
|
-
children: "Your weekly offers",
|
|
110
|
-
},
|
|
111
|
-
parameters: {
|
|
112
|
-
docs: {
|
|
113
|
-
description: {
|
|
114
|
-
story: "Displays all the colour variations supported for Badge and Pill.",
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
render: (args) => (
|
|
119
|
-
<>
|
|
120
|
-
<div className="coop-pill-group">
|
|
121
|
-
<Pill {...args} pillColor="blue" />
|
|
122
|
-
<Pill {...args} pillColor="pink" />
|
|
123
|
-
</div>
|
|
124
|
-
<div className="coop-pill-group">
|
|
125
|
-
<Pill {...args} badge="NEW" pillColor="blue" badgeColor="red" />
|
|
126
|
-
<Pill {...args} badge="NEW" pillColor="blue" badgeColor="green" />
|
|
127
|
-
<Pill {...args} badge="NEW" pillColor="blue" badgeColor="orange" />
|
|
128
|
-
<Pill {...args} badge="NEW" pillColor="blue" badgeColor="pink" />
|
|
129
|
-
</div>
|
|
130
|
-
<div className="coop-pill-group">
|
|
131
|
-
<Pill {...args} badge="NEW" pillColor="pink" badgeColor="red" />
|
|
132
|
-
<Pill {...args} badge="NEW" pillColor="pink" badgeColor="green" />
|
|
133
|
-
<Pill {...args} badge="NEW" pillColor="pink" badgeColor="orange" />
|
|
134
|
-
<Pill {...args} badge="NEW" pillColor="pink" badgeColor="pink" />
|
|
135
|
-
</div>
|
|
136
|
-
</>
|
|
137
|
-
),
|
|
138
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @vitest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { render, cleanup } from "@testing-library/react"
|
|
6
|
-
import { describe, it, afterEach } from "vitest"
|
|
7
|
-
import { Pill } from "."
|
|
8
|
-
|
|
9
|
-
afterEach(() => {
|
|
10
|
-
cleanup()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
describe("Pill", () => {
|
|
14
|
-
it("Renders default Pill", () => {
|
|
15
|
-
render(<Pill href="test/abc">Add missing receipt</Pill>)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it("Renders Pill with badge", () => {
|
|
19
|
-
render(
|
|
20
|
-
<Pill href="test/abc" badge="NEW">
|
|
21
|
-
<span>Add missing receipt</span>
|
|
22
|
-
</Pill>
|
|
23
|
-
)
|
|
24
|
-
})
|
|
25
|
-
})
|