Skip to content

Commit cea0a69

Browse files
committed
docs(breadcrumb): refactor tests
Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. Disabled and dragged was also moved to state data item instead of applying to all tests.
1 parent 8ad6690 commit cea0a69

File tree

1 file changed

+30
-85
lines changed

1 file changed

+30
-85
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,54 @@
11
import { Variants } from "@spectrum-css/preview/decorators";
22
import { Template } from "./template.js";
33

4-
const DefaultItems = [
5-
{
6-
label: "Nav root",
7-
},
8-
{
9-
label: "Dragged",
10-
isDragged: true,
11-
},
12-
{
13-
label: "Disabled sub item",
14-
isDisabled: true,
15-
},
16-
{
17-
label: "January 2019 assets",
18-
},
19-
];
20-
21-
const NestedItems = [
22-
{
23-
iconName: "FolderOpen",
24-
iconSet: "workflow",
25-
},
26-
{
27-
label: "Dragged",
28-
isDragged: true,
29-
},
30-
{
31-
label: "Disabled",
32-
isDisabled: true,
33-
},
34-
{
35-
label: "January 2019 assets",
36-
},
37-
];
38-
39-
const NestedRootVisibleItems = [
40-
{
41-
label: "Nav root",
42-
},
43-
{
44-
iconName: "FolderOpen",
45-
iconSet: "workflow",
46-
isDisabled: true,
47-
},
48-
{
49-
label: "Dragged sub item",
50-
isDragged: true,
51-
},
52-
{
53-
label: "January 2019 assets",
54-
},
55-
];
56-
574
export const BreadcrumbGroup = Variants({
585
Template,
596
testData: [
607
{
618
testHeading: "Default",
62-
items: DefaultItems,
63-
},
64-
{
65-
testHeading: "Default (nested)",
66-
items: NestedItems,
679
},
6810
{
69-
testHeading: "Default (nested, root visible)",
70-
items: NestedRootVisibleItems,
71-
},
72-
{
73-
testHeading: "Compact",
74-
variant: "compact",
75-
items: DefaultItems,
76-
},
77-
{
78-
testHeading: "Compact (nested)",
79-
variant: "compact",
80-
items: NestedItems,
81-
},
82-
{
83-
testHeading: "Compact (nested, root visible)",
84-
variant: "compact",
85-
items: NestedRootVisibleItems,
11+
testHeading: "Large",
12+
size: "l",
8613
},
8714
{
8815
testHeading: "Multiline",
8916
variant: "multiline",
90-
items: DefaultItems,
9117
},
9218
{
93-
testHeading: "Multiline (nested)",
19+
testHeading: "Multiline with small heading",
9420
variant: "multiline",
95-
items: NestedItems,
96-
},
97-
{
98-
testHeading: "Multiline (nested, root visible)",
99-
variant: "multiline",
100-
items: NestedRootVisibleItems,
21+
titleHeadingSize: "s",
10122
},
10223
],
10324
stateData: [
10425
{
105-
testHeading: "Dragged, disabled",
26+
testHeading: "Nested",
27+
showTruncatedMenu: true,
28+
},
29+
{
30+
testHeading: "Nested with root context",
31+
showTruncatedMenu: true,
32+
showRootContext: true,
33+
},
34+
{
35+
testHeading: "Disabled items and dragged item",
10636
isDragged: true,
107-
}
37+
showTruncatedMenu: true,
38+
truncatedMenuIsDisabled: true,
39+
items: [
40+
{
41+
label: "Dragged item",
42+
isDragged: true,
43+
},
44+
{
45+
label: "Disabled sub item",
46+
isDisabled: true,
47+
},
48+
{
49+
label: "January 2019 assets",
50+
},
51+
]
52+
},
10853
]
10954
});

0 commit comments

Comments
 (0)