Skip to content

Commit

Permalink
Merge pull request #7042 from Sage/FE-6366
Browse files Browse the repository at this point in the history
chore(select): ensure test stories callbacks work and cleanup controls
  • Loading branch information
nuria1110 authored Oct 30, 2024
2 parents 7665ab9 + 29837da commit 681a4a3
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,63 @@ import Button from "../../button";
export default {
component: FilterableSelect,
title: "Select/Filterable/Test",
excludeStories: [],
parameters: {
info: { disable: true },
chromatic: {
disableSnapshot: true,
},
controls: {
exclude: [
"onChange",
"onChangeDeferred",
"onFilterChange",
"onListScrollBottom",
"onListAction",
"onOpen",
"onBlur",
"onClick",
"onFocus",
"onKeyDown",
"onMouseDown",
"iconOnClick",
"iconOnMouseDown",
"children",
"value",
"defaultValue",
"tableHeader",
"multiColumn",
"leftChildren",
"listActionButton",
"as",
],
},
},
argTypes: {
error: {
control: {
type: "text",
},
},
warning: {
control: {
type: "text",
},
},
info: {
control: {
type: "text",
},
},
fieldHelp: {
control: {
type: "text",
},
},
labelHelp: {
control: {
type: "text",
},
},
},
};

Expand Down
50 changes: 49 additions & 1 deletion src/components/select/multi-select/multi-select-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,60 @@ import CarbonProvider from "../../carbon-provider/carbon-provider.component";
export default {
component: MultiSelect,
title: "Select/MultiSelect/Test",
excludeStories: [""],
parameters: {
info: { disable: true },
chromatic: {
disableSnapshot: true,
},
controls: {
exclude: [
"onChange",
"onChangeDeferred",
"onFilterChange",
"onOpen",
"onBlur",
"onClick",
"onFocus",
"onKeyDown",
"onMouseDown",
"iconOnClick",
"iconOnMouseDown",
"children",
"value",
"defaultValue",
"tableHeader",
"multiColumn",
"leftChildren",
"as",
],
},
},
argTypes: {
error: {
control: {
type: "text",
},
},
warning: {
control: {
type: "text",
},
},
info: {
control: {
type: "text",
},
},
fieldHelp: {
control: {
type: "text",
},
},
labelHelp: {
control: {
type: "text",
},
},
},
};

Expand Down
90 changes: 40 additions & 50 deletions src/components/select/simple-select/simple-select-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,69 +12,59 @@ import { Select, Option, SimpleSelectProps } from "..";
export default {
component: Select,
title: "Select/Test",
excludeStories: [""],
parameters: {
info: { disable: true },
chromatic: {
disableSnapshot: true,
},
controls: {
exclude: [
"onChange",
"onChangeDeferred",
"onListScrollBottom",
"onOpen",
"onBlur",
"onClick",
"onFocus",
"onKeyDown",
"onMouseDown",
"iconOnClick",
"iconOnMouseDown",
"children",
"value",
"defaultValue",
"tableHeader",
"multiColumn",
"leftChildren",
"as",
],
},
},
argTypes: {
value: { table: { disable: true }, control: false },
defaultValue: { table: { disable: true }, control: false },
children: { table: { disable: true }, control: false },
openOnFocus: { table: { disable: true }, control: false },
transparent: { table: { disable: true }, control: false },
tableHeader: { table: { disable: true }, control: false },
multiColumn: { table: { disable: true }, control: false },
isLoading: { table: { disable: true }, control: false },
onListScrollBottom: { table: { disable: true }, control: false },
tooltipPosition: { table: { disable: true }, control: false },
"data-component": { table: { disable: true }, control: false },
"data-element": { table: { disable: true }, control: false },
"data-role": { table: { disable: true }, control: false },
listPlacement: {
options: [
"top",
"bottom",
"top-start",
"bottom-start",
"top-end",
"bottom-end",
],
error: {
control: {
type: "select",
type: "text",
},
},
onOpen: {
action: "onOpen",
table: { disable: true },
control: false,
},
onChange: {
action: "onChange",
table: { disable: true },
control: false,
},
onClick: {
action: "onClick",
table: { disable: true },
control: false,
warning: {
control: {
type: "text",
},
},
onFocus: {
action: "onFocus",
table: { disable: true },
control: false,
info: {
control: {
type: "text",
},
},
onBlur: {
action: "onBlur",
table: { disable: true },
control: false,
fieldHelp: {
control: {
type: "text",
},
},
onKeyDown: {
action: "onKeyDown",
table: { disable: true },
control: false,
labelHelp: {
control: {
type: "text",
},
},
},
};
Expand Down

0 comments on commit 681a4a3

Please sign in to comment.