Skip to content

Commit

Permalink
test: update and clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispulsinelli-okta committed Dec 1, 2023
1 parent 43c710c commit 7cacefc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export const Optional: StoryObj<AutocompleteType> = {
export const ReadOnly: StoryObj<AutocompleteType> = {
args: {
isReadOnly: true,
value: { label: "Tycho Station" },
defaultValue: { label: "Tycho Station" },
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,14 @@ export const Controlled: StoryObj<typeof PasswordField> = {
(event) => setLocalValue(event?.target.value),
[]
);
return <PasswordField {...props} value={localValue} onChange={onChange} />;
return (
<PasswordField
{...props}
defaultValue={undefined}
value={localValue}
onChange={onChange}
/>
);
},
};

Expand All @@ -298,6 +305,13 @@ export const ControlledDefaultInput: StoryObj<typeof PasswordField> = {
(event) => setLocalValue(event?.target.value),
[]
);
return <PasswordField {...props} value={localValue} onChange={onChange} />;
return (
<PasswordField
{...props}
defaultValue={undefined}
value={localValue}
onChange={onChange}
/>
);
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const ControlledSearch: StoryObj<typeof SearchField> = {
defaultValue: undefined,
},
render: function C(props) {
const [constrolledValue, setControlledValue] = useState("Foo");
const [constrolledValue, setControlledValue] = useState("Jupiter");
const onChange = useCallback(
(event) => setControlledValue(event.target.value),
[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const storybookMeta: Meta<typeof TextField> = {
},
args: {
label: "Destination",
defaultValue: undefined,
},
decorators: [MuiThemeDecorator],
tags: ["autodocs"],
Expand Down Expand Up @@ -307,7 +308,7 @@ export const ControlledTextField: StoryObj<typeof TextField> = {
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),
Expand Down

0 comments on commit 7cacefc

Please sign in to comment.