Skip to content

Commit 316e93b

Browse files
authored
fix: Override iconName documenter value (#32)
* fix: Override iconName documenter value * fix: Filter * remove if check
1 parent f070a7e commit 316e93b

File tree

2 files changed

+7
-101
lines changed

2 files changed

+7
-101
lines changed

src/__tests__/__snapshots__/documenter.test.ts.snap

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -41,107 +41,7 @@ If you set both \`iconName\` and \`initials\`, \`initials\` will take precedence
4141
"inlineType": {
4242
"name": "IconProps.Name",
4343
"type": "union",
44-
"values": [
45-
"add-plus",
46-
"anchor-link",
47-
"angle-left-double",
48-
"angle-left",
49-
"angle-right-double",
50-
"angle-right",
51-
"angle-up",
52-
"angle-down",
53-
"arrow-left",
54-
"arrow-right",
55-
"audio-full",
56-
"audio-half",
57-
"audio-off",
58-
"bug",
59-
"call",
60-
"calendar",
61-
"caret-down-filled",
62-
"caret-down",
63-
"caret-left-filled",
64-
"caret-right-filled",
65-
"caret-up-filled",
66-
"caret-up",
67-
"check",
68-
"contact",
69-
"close",
70-
"copy",
71-
"delete-marker",
72-
"download",
73-
"drag-indicator",
74-
"edit",
75-
"ellipsis",
76-
"envelope",
77-
"expand",
78-
"external",
79-
"file-open",
80-
"file",
81-
"filter",
82-
"flag",
83-
"folder-open",
84-
"folder",
85-
"gen-ai",
86-
"group-active",
87-
"group",
88-
"heart",
89-
"heart-filled",
90-
"insert-row",
91-
"key",
92-
"keyboard",
93-
"lock-private",
94-
"menu",
95-
"microphone",
96-
"microphone-off",
97-
"multiscreen",
98-
"notification",
99-
"redo",
100-
"refresh",
101-
"remove",
102-
"resize-area",
103-
"script",
104-
"search",
105-
"security",
106-
"settings",
107-
"send",
108-
"share",
109-
"shrink",
110-
"star-filled",
111-
"star-half",
112-
"star",
113-
"status-in-progress",
114-
"status-info",
115-
"status-negative",
116-
"status-pending",
117-
"status-positive",
118-
"status-stopped",
119-
"status-warning",
120-
"subtract-minus",
121-
"suggestions",
122-
"thumbs-down-filled",
123-
"thumbs-down",
124-
"thumbs-up-filled",
125-
"thumbs-up",
126-
"ticket",
127-
"treeview-collapse",
128-
"treeview-expand",
129-
"undo",
130-
"unlocked",
131-
"upload-download",
132-
"upload",
133-
"user-profile-active",
134-
"user-profile",
135-
"video-off",
136-
"video-on",
137-
"video-unavailable",
138-
"view-full",
139-
"view-horizontal",
140-
"view-vertical",
141-
"zoom-in",
142-
"zoom-out",
143-
"zoom-to-fit",
144-
],
44+
"values": "comes from @cloudscape-design/components",
14545
},
14646
"name": "iconName",
14747
"optional": true,

src/__tests__/documenter.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ import { getAllComponents, requireComponentDefinition } from "./utils";
66

77
test.each<string>(getAllComponents())(`definition for %s matches the snapshot`, (componentName: string) => {
88
const definition = requireComponentDefinition(componentName);
9+
10+
// overriding with a fake value so that when there are icon changes in components this test doesn't block it
11+
const iconNameDefinition = definition.properties.filter(({ name }: { name: string }) => name === "iconName");
12+
if (iconNameDefinition && iconNameDefinition[0]) {
13+
iconNameDefinition[0].inlineType.values = "comes from @cloudscape-design/components";
14+
}
915
expect(definition).toMatchSnapshot(componentName);
1016
});

0 commit comments

Comments
 (0)