Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Dec 7, 2021
1 parent d4b439c commit f63b6b9
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions packages/ra-core/src/form/useInput.spec.tsx
Expand Up @@ -209,31 +209,30 @@ describe('useInput', () => {

it('does not apply the initialValue when input has a value of 0', () => {
const { queryByDisplayValue } = renderWithRedux(
<RecordContextProvider value={{ id: 1, views: 0 }}>
<FormWithRedirect
onSubmit={jest.fn()}
render={() => {
return (
<Input
source="views"
resource="posts"
initialValue={99}
>
{({ id, input }) => {
return (
<input
type="number"
id={id}
aria-label="Views"
{...input}
/>
);
}}
</Input>
);
}}
/>
</RecordContextProvider>
<FormWithRedirect
onSubmit={jest.fn()}
record={{ id: 1, views: 0 }}
render={() => {
return (
<Input
source="views"
resource="posts"
initialValue={99}
>
{({ id, input }) => {
return (
<input
type="number"
id={id}
aria-label="Views"
{...input}
/>
);
}}
</Input>
);
}}
/>
);
expect(queryByDisplayValue('99')).toBeNull();
});
Expand Down

0 comments on commit f63b6b9

Please sign in to comment.