@ogcio/design-system-react 1.11.2 → 1.11.3
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/package.json +4 -4
- package/dist/accordion/accordion.test.d.ts +0 -1
- package/dist/accordion/accordion.test.js +0 -61
- package/dist/alert/alert.test.d.ts +0 -1
- package/dist/alert/alert.test.js +0 -45
- package/dist/blockquote/blockquote.test.d.ts +0 -1
- package/dist/blockquote/blockquote.test.js +0 -21
- package/dist/breadcrumbs/breadcrumbs.test.d.ts +0 -1
- package/dist/breadcrumbs/breadcrumbs.test.js +0 -43
- package/dist/button/button.test.d.ts +0 -1
- package/dist/button/button.test.js +0 -78
- package/dist/button-group/button-group.test.d.ts +0 -1
- package/dist/button-group/button-group.test.js +0 -2982
- package/dist/card/card.test.d.ts +0 -1
- package/dist/card/card.test.js +0 -130
- package/dist/combo-box/dropdown-item.test.d.ts +0 -1
- package/dist/combo-box/dropdown-item.test.js +0 -88
- package/dist/container/container.test.d.ts +0 -1
- package/dist/container/container.test.js +0 -28
- package/dist/cookie-banner/cookie-banner.test.d.ts +0 -1
- package/dist/cookie-banner/cookie-banner.test.js +0 -20
- package/dist/details/details.test.d.ts +0 -1
- package/dist/details/details.test.js +0 -50
- package/dist/drawer/drawer.test.d.ts +0 -1
- package/dist/drawer/drawer.test.js +0 -69
- package/dist/error-text/error-text.test.d.ts +0 -1
- package/dist/error-text/error-text.test.js +0 -30
- package/dist/footer/footer.test.d.ts +0 -1
- package/dist/footer/footer.test.js +0 -42
- package/dist/header/header.test.d.ts +0 -1
- package/dist/header/header.test.js +0 -95
- package/dist/hint-text/hint-text.test.d.ts +0 -1
- package/dist/hint-text/hint-text.test.js +0 -31
- package/dist/icon/icon.test.d.ts +0 -1
- package/dist/icon/icon.test.js +0 -53
- package/dist/icon-button/icon-button.test.d.ts +0 -1
- package/dist/icon-button/icon-button.test.js +0 -56
- package/dist/input-password/input-password.test.d.ts +0 -1
- package/dist/input-password/input-password.test.js +0 -16
- package/dist/label/label.test.d.ts +0 -1
- package/dist/label/label.test.js +0 -49
- package/dist/link/link.test.d.ts +0 -1
- package/dist/link/link.test.js +0 -66
- package/dist/list/list.test.d.ts +0 -1
- package/dist/list/list.test.js +0 -67
- package/dist/modal/modal.test.d.ts +0 -1
- package/dist/modal/modal.test.js +0 -81
- package/dist/pagination/pagination.test.d.ts +0 -1
- package/dist/pagination/pagination.test.js +0 -95
- package/dist/paragraph/paragraph.test.d.ts +0 -1
- package/dist/paragraph/paragraph.test.js +0 -63
- package/dist/phase-banner/phase-banner.test.d.ts +0 -1
- package/dist/phase-banner/phase-banner.test.js +0 -27
- package/dist/primitives/anchor.test.d.ts +0 -1
- package/dist/primitives/anchor.test.js +0 -39
- package/dist/progress-bar/progress-bar.test.d.ts +0 -1
- package/dist/progress-bar/progress-bar.test.js +0 -34
- package/dist/progress-stepper/progress-stepper.test.d.ts +0 -1
- package/dist/progress-stepper/progress-stepper.test.js +0 -117
- package/dist/section-break/section-break.test.d.ts +0 -1
- package/dist/section-break/section-break.test.js +0 -36
- package/dist/spinner/spinner.test.d.ts +0 -1
- package/dist/spinner/spinner.test.js +0 -11
- package/dist/stack/stack.test.d.ts +0 -1
- package/dist/stack/stack.test.js +0 -44
- package/dist/summary-list/summary-list.test.d.ts +0 -1
- package/dist/summary-list/summary-list.test.js +0 -56
- package/dist/table/table.test.d.ts +0 -1
- package/dist/table/table.test.js +0 -18
- package/dist/tabs/tabs.test.d.ts +0 -1
- package/dist/tabs/tabs.test.js +0 -44
- package/dist/tag/tag.test.d.ts +0 -1
- package/dist/tag/tag.test.js +0 -40
- package/dist/test-utilities-BS7B3BF-.js +0 -34112
- package/dist/test-utilities.d.ts +0 -8
- package/dist/test-utilities.js +0 -87
- package/dist/toast/toast.test.d.ts +0 -1
- package/dist/toast/toast.test.js +0 -44
- package/dist/tooltip/tooltip.test.d.ts +0 -1
- package/dist/tooltip/tooltip.test.js +0 -85
- package/dist/utils/utilities.test.d.ts +0 -1
- package/dist/utils/utilities.test.js +0 -79
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as a, r as n } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { ProgressBar as c } from "./progress-bar.js";
|
|
4
|
-
describe("ProgressBar", () => {
|
|
5
|
-
afterEach(a);
|
|
6
|
-
const t = (s) => n(/* @__PURE__ */ o(c, { ...s }));
|
|
7
|
-
it("should render a progress bar with a specified value", () => {
|
|
8
|
-
const e = t({
|
|
9
|
-
value: 50
|
|
10
|
-
}).getByTestId("progress-bar");
|
|
11
|
-
expect(e).toBeTruthy();
|
|
12
|
-
const r = e.firstElementChild;
|
|
13
|
-
expect(r).toBeTruthy(), expect(r).toHaveStyle("width: 50%");
|
|
14
|
-
}), it("should render an indeterminate progress bar correctly", () => {
|
|
15
|
-
const e = t({
|
|
16
|
-
isIndeterminate: !0
|
|
17
|
-
}).getByTestId("progress-bar");
|
|
18
|
-
expect(e).toBeTruthy();
|
|
19
|
-
const r = e.firstElementChild;
|
|
20
|
-
expect(r).toBeTruthy(), expect(r).toHaveClass("gi-progress-bar-indeterminate");
|
|
21
|
-
}), it("should render progress bar with final value set", () => {
|
|
22
|
-
const e = t({
|
|
23
|
-
max: 500,
|
|
24
|
-
value: 200
|
|
25
|
-
}).getByTestId("progress-bar");
|
|
26
|
-
expect(e).toBeTruthy();
|
|
27
|
-
const r = e.firstElementChild;
|
|
28
|
-
expect(r).toBeTruthy(), expect(r).toHaveStyle("width: 40%");
|
|
29
|
-
}), it("should pass axe accessibility tests", async () => {
|
|
30
|
-
await t({
|
|
31
|
-
value: 75
|
|
32
|
-
}).axe();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { c as d, r as h } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { ProgressStepper as a, StepItem as t } from "./progress-stepper.js";
|
|
4
|
-
describe("govieProgressStepper", () => {
|
|
5
|
-
afterEach(d);
|
|
6
|
-
const c = (n) => h(/* @__PURE__ */ e(a, { ...n }));
|
|
7
|
-
it("should render a horizontal progress stepper correctly", () => {
|
|
8
|
-
const r = [
|
|
9
|
-
...c({
|
|
10
|
-
children: [
|
|
11
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
12
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
13
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
14
|
-
],
|
|
15
|
-
currentStepIndex: 1
|
|
16
|
-
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
17
|
-
];
|
|
18
|
-
expect(r.length).toBe(3), expect(r[0].dataset.completed).toBe("true"), expect(r[1].dataset.current).toBe("true"), expect(r[2].dataset.next).toBe("true");
|
|
19
|
-
}), it("should render a vertical progress stepper correctly", () => {
|
|
20
|
-
const r = [
|
|
21
|
-
...c({
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
24
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
25
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
26
|
-
],
|
|
27
|
-
currentStepIndex: 2,
|
|
28
|
-
orientation: "vertical"
|
|
29
|
-
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
30
|
-
];
|
|
31
|
-
expect(r[2].dataset.current).toBe("true");
|
|
32
|
-
}), it("should mark all steps as completed when completeAll is true", () => {
|
|
33
|
-
const r = [
|
|
34
|
-
...c({
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
37
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
38
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
39
|
-
],
|
|
40
|
-
completeAll: !0
|
|
41
|
-
}).getByTestId("progress-stepper").querySelectorAll(".gi-progress-stepper-step-container")
|
|
42
|
-
];
|
|
43
|
-
for (const l of r)
|
|
44
|
-
expect(l.dataset.completed).toBe("true"), expect(l.dataset.current).not.toBe("true"), expect(l.dataset.next).not.toBe("true");
|
|
45
|
-
expect(r.length).toBe(3);
|
|
46
|
-
}), it("should show slot content for the current and previous step index when vertical orientation", async () => {
|
|
47
|
-
const n = c({
|
|
48
|
-
currentStepIndex: 1,
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
51
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
52
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
53
|
-
],
|
|
54
|
-
orientation: "vertical"
|
|
55
|
-
}), p = n.getByTestId("vertical-step-slot-0"), r = n.getByTestId("vertical-step-slot-1"), l = n.queryByTestId("vertical-step-slot-2");
|
|
56
|
-
expect(p).toBeInTheDocument(), expect(r).toBeInTheDocument(), expect(l).toBeNull();
|
|
57
|
-
}), it("should show slot content for the current step index", async () => {
|
|
58
|
-
const n = c({
|
|
59
|
-
currentStepIndex: 0,
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
62
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
63
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
64
|
-
]
|
|
65
|
-
}), p = n.getByTestId("horizontal-step-slot-0"), r = n.queryByTestId("horizontal-step-slot-1"), l = n.queryByTestId("horizontal-step-slot-2");
|
|
66
|
-
expect(p).toBeInTheDocument(), expect(r).toBeNull(), expect(l).toBeNull();
|
|
67
|
-
}), it('should default open slot content while vertical orientation when "defaultOpen" is true', () => {
|
|
68
|
-
const n = c({
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ e(t, { label: "Step 1", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
71
|
-
/* @__PURE__ */ e(t, { label: "Step 2", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
72
|
-
/* @__PURE__ */ e(t, { label: "Step 3", defaultOpen: !0, children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
73
|
-
],
|
|
74
|
-
orientation: "vertical"
|
|
75
|
-
}), p = n.getByTestId("vertical-step-slot-0"), r = n.getByTestId("vertical-step-slot-1"), l = n.getByTestId("vertical-step-slot-2");
|
|
76
|
-
expect(p).toBeInTheDocument(), expect(r).toBeInTheDocument(), expect(l).toBeInTheDocument();
|
|
77
|
-
}), it('should check step numbers when "indicator" is a number', () => {
|
|
78
|
-
var r, l;
|
|
79
|
-
const p = c({
|
|
80
|
-
indicator: "number",
|
|
81
|
-
children: [
|
|
82
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
83
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
84
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
85
|
-
]
|
|
86
|
-
}).getAllByRole("listitem");
|
|
87
|
-
for (const o of p) {
|
|
88
|
-
const s = (l = (r = o.querySelector(".gi-progress-stepper-step")) == null ? void 0 : r.textContent) == null ? void 0 : l.trim();
|
|
89
|
-
expect(!Number.isNaN(Number(s))).toBe(!0);
|
|
90
|
-
}
|
|
91
|
-
}), it('should have a check icon for the completed steps when "indicator" is a number', () => {
|
|
92
|
-
const n = c({
|
|
93
|
-
indicator: "number",
|
|
94
|
-
currentStepIndex: 2,
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }),
|
|
97
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }),
|
|
98
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) })
|
|
99
|
-
]
|
|
100
|
-
}), [p, r, l] = n.getAllByRole("listitem").map(
|
|
101
|
-
(o) => {
|
|
102
|
-
var s, i;
|
|
103
|
-
return (i = (s = o.querySelector(".gi-progress-stepper-step")) == null ? void 0 : s.textContent) == null ? void 0 : i.trim();
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
expect(p).toBe("check"), expect(r).toBe("check"), expect(l).toBe("3");
|
|
107
|
-
}), it("should pass axe accessibility tests", async () => {
|
|
108
|
-
await c({
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ e(t, { label: "Step 1", children: /* @__PURE__ */ e("div", { children: "Step 1 Content" }) }, "step-1"),
|
|
111
|
-
/* @__PURE__ */ e(t, { label: "Step 2", children: /* @__PURE__ */ e("div", { children: "Step 2 Content" }) }, "step-2"),
|
|
112
|
-
/* @__PURE__ */ e(t, { label: "Step 3", children: /* @__PURE__ */ e("div", { children: "Step 3 Content" }) }, "step-3")
|
|
113
|
-
],
|
|
114
|
-
currentStepIndex: 0
|
|
115
|
-
}).axe();
|
|
116
|
-
});
|
|
117
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { c as o, r as i } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { SectionBreak as r } from "./section-break.js";
|
|
4
|
-
describe("govieSectionBreak", () => {
|
|
5
|
-
afterEach(o);
|
|
6
|
-
const t = (s) => i(/* @__PURE__ */ c(r, { ...s }));
|
|
7
|
-
it('should have correct text size classes for "xl"', () => {
|
|
8
|
-
const e = t({
|
|
9
|
-
size: "xl",
|
|
10
|
-
dataTestid: "govie-section-break"
|
|
11
|
-
}).getByTestId("govie-section-break");
|
|
12
|
-
expect(e.classList.contains("gi-section-break-xl")).toBe(!0);
|
|
13
|
-
}), it('should have correct text size classes for "lg"', () => {
|
|
14
|
-
const e = t({
|
|
15
|
-
size: "lg",
|
|
16
|
-
dataTestid: "govie-section-break"
|
|
17
|
-
}).getByTestId("govie-section-break");
|
|
18
|
-
expect(e.classList.contains("gi-section-break-lg")).toBe(!0);
|
|
19
|
-
}), it('should have correct text size classes for "md"', () => {
|
|
20
|
-
const e = t({
|
|
21
|
-
size: "md",
|
|
22
|
-
dataTestid: "govie-section-break"
|
|
23
|
-
}).getByTestId("govie-section-break");
|
|
24
|
-
expect(e.classList.contains("gi-section-break-md")).toBe(!0);
|
|
25
|
-
}), it('should have correct text size classes for "sm"', () => {
|
|
26
|
-
const e = t({
|
|
27
|
-
size: "sm",
|
|
28
|
-
dataTestid: "govie-section-break"
|
|
29
|
-
}).getByTestId("govie-section-break");
|
|
30
|
-
expect(e.classList.contains("gi-section-break-sm")).toBe(!0);
|
|
31
|
-
}), it("should pass axe accessibility tests", async () => {
|
|
32
|
-
await t({
|
|
33
|
-
size: "md"
|
|
34
|
-
}).axe();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as i, t as s, r as t } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { spinnerSizeVariants as o, Spinner as a } from "./spinner.js";
|
|
4
|
-
describe("govieSpinner", () => {
|
|
5
|
-
afterEach(i);
|
|
6
|
-
const r = (e) => t(/* @__PURE__ */ n(a, { ...e }));
|
|
7
|
-
s(
|
|
8
|
-
Reflect.ownKeys(o),
|
|
9
|
-
(e) => r({ size: e })
|
|
10
|
-
);
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/stack/stack.test.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { c as s, r as n } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { Stack as o } from "./stack.js";
|
|
4
|
-
describe("govieStack", () => {
|
|
5
|
-
afterEach(s);
|
|
6
|
-
const i = (e) => n(/* @__PURE__ */ t(o, { ...e, "data-testid": "govie-stack" })), c = [
|
|
7
|
-
/* @__PURE__ */ t("div", { children: "item 1" }, "stack_1"),
|
|
8
|
-
/* @__PURE__ */ t("div", { children: "item 2" }, "stack_2"),
|
|
9
|
-
/* @__PURE__ */ t("div", { children: "item 3" }, "stack_3")
|
|
10
|
-
];
|
|
11
|
-
it("should Stack items render correctly", () => {
|
|
12
|
-
const e = i({
|
|
13
|
-
direction: "column",
|
|
14
|
-
itemsAlignment: "center",
|
|
15
|
-
itemsDistribution: "end",
|
|
16
|
-
gap: 1,
|
|
17
|
-
children: c
|
|
18
|
-
});
|
|
19
|
-
expect(e.getByTestId("govie-stack")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-0")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-1")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-2")).toBeInTheDocument();
|
|
20
|
-
}), it("should Stack items render correctly with breakpoint configuration", () => {
|
|
21
|
-
const e = i({
|
|
22
|
-
direction: {
|
|
23
|
-
base: "column",
|
|
24
|
-
md: "row"
|
|
25
|
-
},
|
|
26
|
-
gap: {
|
|
27
|
-
sm: 2,
|
|
28
|
-
xs: 1,
|
|
29
|
-
md: 3
|
|
30
|
-
},
|
|
31
|
-
itemsAlignment: "start",
|
|
32
|
-
itemsDistribution: "start",
|
|
33
|
-
children: c
|
|
34
|
-
});
|
|
35
|
-
expect(e.getByTestId("govie-stack")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-0")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-1")).toBeInTheDocument(), expect(e.getByTestId("govie-stack-item-2")).toBeInTheDocument();
|
|
36
|
-
}), it("should pass axe accessibility tests", async () => {
|
|
37
|
-
await i({
|
|
38
|
-
direction: "column",
|
|
39
|
-
itemsAlignment: "start",
|
|
40
|
-
itemsDistribution: "start",
|
|
41
|
-
children: c
|
|
42
|
-
}).axe();
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as i, r as l } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { SummaryList as m, SummaryListRow as r, SummaryListValue as o, SummaryListAction as a } from "./summary-list.js";
|
|
4
|
-
describe("govieSummaryList", () => {
|
|
5
|
-
afterEach(i);
|
|
6
|
-
const c = (e) => l(/* @__PURE__ */ t(m, { ...e }));
|
|
7
|
-
it("should render SummaryList and its rows correctly", () => {
|
|
8
|
-
const { getByText: e } = c({
|
|
9
|
-
children: [
|
|
10
|
-
/* @__PURE__ */ n(r, { label: "Name", children: [
|
|
11
|
-
/* @__PURE__ */ t(o, { children: "John Smith" }),
|
|
12
|
-
/* @__PURE__ */ t(a, { href: "/change-name", children: "Change name" })
|
|
13
|
-
] }, "1"),
|
|
14
|
-
/* @__PURE__ */ n(r, { label: "Date of Birth", children: [
|
|
15
|
-
/* @__PURE__ */ t(o, { children: "8 November 1982" }),
|
|
16
|
-
/* @__PURE__ */ t(a, { href: "/change-dob", children: "Change date of birth" })
|
|
17
|
-
] }, "2")
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
expect(e("Name")).toBeInTheDocument(), expect(e("John Smith")).toBeInTheDocument(), expect(e("Change name")).toBeInTheDocument(), expect(e("Date of Birth")).toBeInTheDocument(), expect(e("8 November 1982")).toBeInTheDocument(), expect(e("Change date of birth")).toBeInTheDocument();
|
|
21
|
-
}), it("should render correctly a row without an action", () => {
|
|
22
|
-
const { getByText: e } = c({
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ t(r, { label: "Address", children: /* @__PURE__ */ n(o, { children: [
|
|
25
|
-
"72 Guild Street",
|
|
26
|
-
/* @__PURE__ */ t("br", {}),
|
|
27
|
-
"London",
|
|
28
|
-
/* @__PURE__ */ t("br", {}),
|
|
29
|
-
"SE23 6FH"
|
|
30
|
-
] }) }, "1")
|
|
31
|
-
]
|
|
32
|
-
});
|
|
33
|
-
expect(e("Address")).toBeInTheDocument(), expect(e("72 Guild Street", { exact: !1 })).toBeInTheDocument(), expect(e("London", { exact: !1 })).toBeInTheDocument(), expect(e("SE23 6FH", { exact: !1 })).toBeInTheDocument();
|
|
34
|
-
}), it("should render correctly with `withBorder` prop", () => {
|
|
35
|
-
const { getByText: e } = c({
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ t(r, { label: "Contact Details", withBorder: !0, children: /* @__PURE__ */ n(o, { children: [
|
|
38
|
-
"07700 900900",
|
|
39
|
-
/* @__PURE__ */ t("br", {}),
|
|
40
|
-
"john.smith@example.com"
|
|
41
|
-
] }) }, "1")
|
|
42
|
-
]
|
|
43
|
-
}), h = e("Contact Details").closest("dl");
|
|
44
|
-
expect(h).toHaveAttribute("data-border", "true");
|
|
45
|
-
}), it("should pass axe accessibility tests", async () => {
|
|
46
|
-
const { axe: e } = c({
|
|
47
|
-
children: [
|
|
48
|
-
/* @__PURE__ */ n(r, { label: "Name", children: [
|
|
49
|
-
/* @__PURE__ */ t(o, { children: "John Smith" }),
|
|
50
|
-
/* @__PURE__ */ t(a, { href: "/change-name", children: "Change name" })
|
|
51
|
-
] }, "1")
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
await e();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/table/table.test.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as a, r as n } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { TableContent as r } from "./table-content.js";
|
|
4
|
-
import { Table as o } from "./table.js";
|
|
5
|
-
describe("table", () => {
|
|
6
|
-
afterEach(a);
|
|
7
|
-
const t = (e) => n(/* @__PURE__ */ s(o, { ...e }));
|
|
8
|
-
it("should render table", () => {
|
|
9
|
-
const e = t({
|
|
10
|
-
children: r
|
|
11
|
-
});
|
|
12
|
-
expect(e.getByText("This is the table head")).toBeTruthy();
|
|
13
|
-
}), it("should pass axe tests", async () => {
|
|
14
|
-
await t({
|
|
15
|
-
children: r
|
|
16
|
-
}).axe();
|
|
17
|
-
});
|
|
18
|
-
});
|
package/dist/tabs/tabs.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tabs/tabs.test.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as o, f as i, r as c } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { TabsContent as s } from "./tabs-content.js";
|
|
4
|
-
import { Tabs as l } from "./tabs.js";
|
|
5
|
-
describe("tabs", () => {
|
|
6
|
-
afterEach(o);
|
|
7
|
-
const r = (e) => c(/* @__PURE__ */ n(l, { ...e }));
|
|
8
|
-
it("should render tabs", () => {
|
|
9
|
-
const e = r({
|
|
10
|
-
ariaLabelledBy: "tabs",
|
|
11
|
-
id: "tab-1",
|
|
12
|
-
children: s
|
|
13
|
-
});
|
|
14
|
-
expect(e.getByText("Tab 1 Content")).toBeTruthy();
|
|
15
|
-
}), it("should render tabs", () => {
|
|
16
|
-
const e = r({
|
|
17
|
-
ariaLabelledBy: "tabs",
|
|
18
|
-
id: "tab-1",
|
|
19
|
-
children: s
|
|
20
|
-
});
|
|
21
|
-
expect(e.getByText("Tab 2 Content")).toBeTruthy();
|
|
22
|
-
}), it("should allow selecting a tab", () => {
|
|
23
|
-
const e = r({
|
|
24
|
-
ariaLabelledBy: "tabs",
|
|
25
|
-
id: "tab-1",
|
|
26
|
-
children: s
|
|
27
|
-
}), a = e.container.querySelector('[role="tablist"]'), t = a == null ? void 0 : a.querySelectorAll("button");
|
|
28
|
-
t && (i.click(t[1]), expect(t[1]).toHaveAttribute("aria-selected", "true"), expect(t[0]).toHaveAttribute("aria-selected", "false"), expect(e.getByText("Tab 2 Content")).toBeVisible());
|
|
29
|
-
}), it("should pass axe tests", async () => {
|
|
30
|
-
var a;
|
|
31
|
-
const e = r({
|
|
32
|
-
ariaLabelledBy: "tabs",
|
|
33
|
-
id: "tab-1",
|
|
34
|
-
children: s
|
|
35
|
-
});
|
|
36
|
-
try {
|
|
37
|
-
await e.axe();
|
|
38
|
-
} catch (t) {
|
|
39
|
-
if ((a = t.message) != null && a.includes("input[aria-labelledby]"))
|
|
40
|
-
return;
|
|
41
|
-
throw t;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
package/dist/tag/tag.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tag/tag.test.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as o, r as i } from "../test-utilities-BS7B3BF-.js";
|
|
3
|
-
import { Tag as g, TagTypeEnum as t } from "./tag.js";
|
|
4
|
-
describe("govieTag", () => {
|
|
5
|
-
afterEach(o);
|
|
6
|
-
const a = (e) => i(/* @__PURE__ */ n(g, { ...e }));
|
|
7
|
-
it("should render a tag with the correct content", () => {
|
|
8
|
-
const s = a({
|
|
9
|
-
text: "This is a tag",
|
|
10
|
-
type: t.Default
|
|
11
|
-
}).getByText("This is a tag");
|
|
12
|
-
expect(s).toBeTruthy(), expect(s.tagName).toBe("STRONG");
|
|
13
|
-
});
|
|
14
|
-
const c = {
|
|
15
|
-
[t.Info]: "gi-tag-info",
|
|
16
|
-
[t.Default]: "gi-tag-default",
|
|
17
|
-
[t.Success]: "gi-tag-success",
|
|
18
|
-
[t.Warning]: "gi-tag-warning",
|
|
19
|
-
[t.Error]: "gi-tag-error"
|
|
20
|
-
};
|
|
21
|
-
describe.each(Object.entries(c))(
|
|
22
|
-
"should have the correct class for %s",
|
|
23
|
-
(e, s) => {
|
|
24
|
-
it(`${e} tag`, () => {
|
|
25
|
-
const r = a({
|
|
26
|
-
text: `${e.charAt(0).toUpperCase() + e.slice(1)} tag`,
|
|
27
|
-
type: e
|
|
28
|
-
}).getByText(
|
|
29
|
-
`${e.charAt(0).toUpperCase() + e.slice(1)} tag`
|
|
30
|
-
);
|
|
31
|
-
expect(r.classList.contains(s)).toBe(!0);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
), it("should pass axe accessibility tests", async () => {
|
|
35
|
-
await a({
|
|
36
|
-
text: "Accessible tag",
|
|
37
|
-
type: t.Info
|
|
38
|
-
}).axe();
|
|
39
|
-
});
|
|
40
|
-
});
|