Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Dec 8, 2020
1 parent 0204f50 commit 5d7f6a2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 138 deletions.
2 changes: 2 additions & 0 deletions core/config/test/__snapshots__/stories.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Array [
"/Users/atanasster/component-controls/ui/components/src/Pagination/Pagination.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/PanelContainer/PanelContainer.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Popover/Popover.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/ProgressIndicator/ProgressIndicator.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/SearchInput/SearchInput.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Sidebar/Sidebar.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Source/Source.stories.tsx",
Expand Down Expand Up @@ -108,6 +109,7 @@ Array [
"/Users/atanasster/component-controls/ui/components/src/Pagination/Pagination.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/PanelContainer/PanelContainer.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Popover/Popover.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/ProgressIndicator/ProgressIndicator.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/SearchInput/SearchInput.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Sidebar/Sidebar.stories.tsx",
"/Users/atanasster/component-controls/ui/components/src/Source/Source.stories.tsx",
Expand Down
12 changes: 8 additions & 4 deletions core/instrument/src/babel/extract-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,14 @@ export const extractStoreComponent = async (
if (store.doc) {
const doc: Document = store.doc;
if (doc.componentsLookup) {
const componentNames = Object.keys({
...doc.componentsLookup,
[doc.component as string]: doc.component,
});
const components = doc.componentsLookup;
if (
typeof doc.component === 'string' &&
components[doc.component] === undefined
) {
components[doc.component] = doc.component;
}
const componentNames = Object.keys(components);
if (componentNames) {
for (const componentName of componentNames) {
const { component, componentPackage } = await extractComponent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ Object {
"components": Object {
"26090286b0d42fa7a92590e6843f1687": Object {
"externalDependencies": Object {
"@component-controls/components": Array [
Object {
"importedName": "TableProps",
"name": "TableProps",
},
],
"@component-controls/store": Array [
Object {
"importedName": "StoryContextProvider",
Expand Down
119 changes: 0 additions & 119 deletions core/instrument/test/__snapshots__/extract-props-info.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1020,14 +1020,6 @@ Array values are converted into responsive values.
],
},
},
"expanded": Object {
"description": "object listing the initially expanded rows.",
"parentName": "TableOwnProps",
"type": Object {
"name": "object",
"raw": "{ [key: string]: boolean; }",
},
},
"extraColumns": Object {
"description": "extra custom columns passed to the PropsTable.",
"parentName": "PropsTableOwnProps",
Expand All @@ -1041,14 +1033,6 @@ Array values are converted into responsive values.
],
},
},
"filtering": Object {
"description": "enable/disable filtering.",
"parentName": "TableOwnProps",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"flat": Object {
"description": "if true, will flatten the group by",
"parentName": "PropsTableOwnProps",
Expand All @@ -1057,47 +1041,13 @@ Array values are converted into responsive values.
"raw": "boolean",
},
},
"groupBy": Object {
"description": "field to be grouped by.",
"parentName": "TableOwnProps",
"type": Object {
"name": "array",
"raw": "string[]",
"value": Array [
Object {
"name": "string",
},
],
},
},
"header": Object {
"description": "show or hide the header element.",
"parentName": "TableOwnProps",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"hidden": Object {
"parentName": "HTMLAttributes",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"hiddenColumns": Object {
"description": "list of columns to hide.",
"parentName": "TableOwnProps",
"type": Object {
"name": "array",
"raw": "string[]",
"value": Array [
Object {
"name": "string",
},
],
},
},
"id": Object {
"description": "optional id to be used for the block
if no id is provided, one will be calculated automatically
Expand All @@ -1108,14 +1058,6 @@ from the title.",
"raw": "string",
},
},
"initialSelected": Object {
"description": "initially selected rows",
"parentName": "TableOwnProps",
"type": Object {
"name": "Record<number, boolean>",
"raw": "Record<number, boolean>",
},
},
"inlist": Object {
"parentName": "HTMLAttributes",
"type": Object {
Expand Down Expand Up @@ -1202,14 +1144,6 @@ from the title.",
"raw": "string",
},
},
"itemsLabel": Object {
"description": "string label for 'items' - used in the filter placeholder and grouping header.",
"parentName": "TableOwnProps",
"type": Object {
"name": "string",
"raw": "string",
},
},
"key": Object {
"parentName": "Attributes",
"type": Object {
Expand Down Expand Up @@ -2302,14 +2236,6 @@ if the function returns false, it can stop chabging to the new tab",
"raw": "((event: SyntheticEvent<HTMLDivElement, Event>) => void)",
},
},
"onSelectRowsChange": Object {
"description": "callback when selected rows change",
"parentName": "TableOwnProps",
"type": Object {
"name": "function",
"raw": "((selected: Record<number, boolean>) => void)",
},
},
"onStalled": Object {
"parentName": "DOMAttributes",
"type": Object {
Expand Down Expand Up @@ -2616,14 +2542,6 @@ if the function returns false, it can stop chabging to the new tab",
"raw": "((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null",
},
},
"renderRowSubComponent": Object {
"description": "callback to render a SubComponent row",
"parentName": "TableOwnProps",
"type": Object {
"name": "function",
"raw": "((props: { row: Row<{}>; }) => ReactNode)",
},
},
"resource": Object {
"parentName": "HTMLAttributes",
"type": Object {
Expand All @@ -2645,57 +2563,20 @@ if the function returns false, it can stop chabging to the new tab",
"raw": "string",
},
},
"rowSelect": Object {
"description": "if true, will enable row selection",
"parentName": "TableOwnProps",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"security": Object {
"parentName": "HTMLAttributes",
"type": Object {
"name": "string",
"raw": "string",
},
},
"skipPageReset": Object {
"description": "reset state update while update table data",
"parentName": "TableOwnProps",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"slot": Object {
"parentName": "HTMLAttributes",
"type": Object {
"name": "string",
"raw": "string",
},
},
"sortBy": Object {
"description": "initial sorting",
"parentName": "TableOwnProps",
"type": Object {
"name": "array",
"raw": "SortingRule<any>[]",
"value": Array [
Object {
"name": "SortingRule<any>",
},
],
},
},
"sorting": Object {
"description": "enable.disable sorting.",
"parentName": "TableOwnProps",
"type": Object {
"name": "boolean",
"raw": "boolean",
},
},
"spellCheck": Object {
"parentName": "HTMLAttributes",
"type": Object {
Expand Down
13 changes: 4 additions & 9 deletions ui/blocks/tests/__snapshots__/stories.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,12 @@ exports[`Blocks/ComponentDependencies Local Dependencies 1`] = `
class="css-zivbkl-Cell"
>
<span
class="css-kabhsx-LocalImport"
class="css-dktbw5-LocalImport"
>
<span
class="css-vurnku"
>
<a
class="css-1t54e2w"
href="/docs/id-of-story"
>
Button
</a>
Node
</span>
</span>
<span
Expand All @@ -158,7 +153,7 @@ exports[`Blocks/ComponentDependencies Local Dependencies 1`] = `
<span
class="css-vurnku"
>
ButtonProps
Node
</span>
</span>
</div>
Expand Down Expand Up @@ -193,7 +188,7 @@ exports[`Blocks/ComponentDependencies Local Dependencies 1`] = `
<span
class="css-vurnku"
>
Table
Node
</span>
</span>
</div>
Expand Down
19 changes: 19 additions & 0 deletions ui/components/tests/__snapshots__/stories.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,25 @@ exports[`Components/Popover Overview 1`] = `
</DocumentFragment>
`;

exports[`Components/ProgressIndicator Overview 1`] = `
<DocumentFragment>
<div
class="css-iapobn-ProgressIndicator"
>
<progress
class="css-1fssii9"
max="10"
value="3"
/>
<span
class="css-cagqfd-ProgressIndicator"
>
3
</span>
</div>
</DocumentFragment>
`;

exports[`Components/SearchInput Default Render 1`] = `
<DocumentFragment>
<div
Expand Down

0 comments on commit 5d7f6a2

Please sign in to comment.