From 7cacefc52a75b666fbe76c3bdb8c747f70ec8791 Mon Sep 17 00:00:00 2001 From: Chris Pulsinelli Date: Thu, 23 Nov 2023 15:31:13 -0500 Subject: [PATCH] test: update and clean up tests --- .../Autocomplete/Autocomplete.stories.tsx | 2 +- .../PasswordField/PasswordField.stories.tsx | 18 ++++++++++++++++-- .../SearchField/SearchField.stories.tsx | 2 +- .../TextField/TextField.stories.tsx | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/odyssey-storybook/src/components/odyssey-mui/Autocomplete/Autocomplete.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-mui/Autocomplete/Autocomplete.stories.tsx index 15367334ed..8e9b4158f4 100644 --- a/packages/odyssey-storybook/src/components/odyssey-mui/Autocomplete/Autocomplete.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-mui/Autocomplete/Autocomplete.stories.tsx @@ -331,7 +331,7 @@ export const Optional: StoryObj = { export const ReadOnly: StoryObj = { args: { isReadOnly: true, - value: { label: "Tycho Station" }, + defaultValue: { label: "Tycho Station" }, }, }; diff --git a/packages/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.stories.tsx index 0a15b68e90..c5356c5def 100644 --- a/packages/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-mui/PasswordField/PasswordField.stories.tsx @@ -276,7 +276,14 @@ export const Controlled: StoryObj = { (event) => setLocalValue(event?.target.value), [] ); - return ; + return ( + + ); }, }; @@ -298,6 +305,13 @@ export const ControlledDefaultInput: StoryObj = { (event) => setLocalValue(event?.target.value), [] ); - return ; + return ( + + ); }, }; diff --git a/packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.stories.tsx index 93ef33b5c4..aa577a412c 100644 --- a/packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-mui/SearchField/SearchField.stories.tsx @@ -162,7 +162,7 @@ export const ControlledSearch: StoryObj = { defaultValue: undefined, }, render: function C(props) { - const [constrolledValue, setControlledValue] = useState("Foo"); + const [constrolledValue, setControlledValue] = useState("Jupiter"); const onChange = useCallback( (event) => setControlledValue(event.target.value), [] diff --git a/packages/odyssey-storybook/src/components/odyssey-mui/TextField/TextField.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-mui/TextField/TextField.stories.tsx index 3c60b695d6..b4065a1b82 100644 --- a/packages/odyssey-storybook/src/components/odyssey-mui/TextField/TextField.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-mui/TextField/TextField.stories.tsx @@ -171,6 +171,7 @@ const storybookMeta: Meta = { }, args: { label: "Destination", + defaultValue: undefined, }, decorators: [MuiThemeDecorator], tags: ["autodocs"], @@ -307,7 +308,7 @@ export const ControlledTextField: StoryObj = { args: { value: "Initial state", }, - render: function C(props) { + render: function C({ ...props }) { const [localValue, setLocalValue] = useState("Initial state"); const onChange = useCallback( (event) => setLocalValue(event.target.value),