Skip to content

Commit

Permalink
fix: Override iconName documenter value (#32)
Browse files Browse the repository at this point in the history
* fix: Override iconName documenter value

* fix: Filter

* remove if check
  • Loading branch information
cansuaa authored Nov 1, 2024
1 parent f070a7e commit 316e93b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 101 deletions.
102 changes: 1 addition & 101 deletions src/__tests__/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,107 +41,7 @@ If you set both \`iconName\` and \`initials\`, \`initials\` will take precedence
"inlineType": {
"name": "IconProps.Name",
"type": "union",
"values": [
"add-plus",
"anchor-link",
"angle-left-double",
"angle-left",
"angle-right-double",
"angle-right",
"angle-up",
"angle-down",
"arrow-left",
"arrow-right",
"audio-full",
"audio-half",
"audio-off",
"bug",
"call",
"calendar",
"caret-down-filled",
"caret-down",
"caret-left-filled",
"caret-right-filled",
"caret-up-filled",
"caret-up",
"check",
"contact",
"close",
"copy",
"delete-marker",
"download",
"drag-indicator",
"edit",
"ellipsis",
"envelope",
"expand",
"external",
"file-open",
"file",
"filter",
"flag",
"folder-open",
"folder",
"gen-ai",
"group-active",
"group",
"heart",
"heart-filled",
"insert-row",
"key",
"keyboard",
"lock-private",
"menu",
"microphone",
"microphone-off",
"multiscreen",
"notification",
"redo",
"refresh",
"remove",
"resize-area",
"script",
"search",
"security",
"settings",
"send",
"share",
"shrink",
"star-filled",
"star-half",
"star",
"status-in-progress",
"status-info",
"status-negative",
"status-pending",
"status-positive",
"status-stopped",
"status-warning",
"subtract-minus",
"suggestions",
"thumbs-down-filled",
"thumbs-down",
"thumbs-up-filled",
"thumbs-up",
"ticket",
"treeview-collapse",
"treeview-expand",
"undo",
"unlocked",
"upload-download",
"upload",
"user-profile-active",
"user-profile",
"video-off",
"video-on",
"video-unavailable",
"view-full",
"view-horizontal",
"view-vertical",
"zoom-in",
"zoom-out",
"zoom-to-fit",
],
"values": "comes from @cloudscape-design/components",
},
"name": "iconName",
"optional": true,
Expand Down
6 changes: 6 additions & 0 deletions src/__tests__/documenter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ import { getAllComponents, requireComponentDefinition } from "./utils";

test.each<string>(getAllComponents())(`definition for %s matches the snapshot`, (componentName: string) => {
const definition = requireComponentDefinition(componentName);

// overriding with a fake value so that when there are icon changes in components this test doesn't block it
const iconNameDefinition = definition.properties.filter(({ name }: { name: string }) => name === "iconName");
if (iconNameDefinition && iconNameDefinition[0]) {
iconNameDefinition[0].inlineType.values = "comes from @cloudscape-design/components";
}
expect(definition).toMatchSnapshot(componentName);
});

0 comments on commit 316e93b

Please sign in to comment.