Skip to content

Commit d58152c

Browse files
author
Travis CI
committed
Apply review
1 parent 03e4311 commit d58152c

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

packages/ra-core/src/form/useInput.spec.tsx

+24-25
Original file line numberDiff line numberDiff line change
@@ -209,31 +209,30 @@ describe('useInput', () => {
209209

210210
it('does not apply the initialValue when input has a value of 0', () => {
211211
const { queryByDisplayValue } = renderWithRedux(
212-
<RecordContextProvider value={{ id: 1, views: 0 }}>
213-
<FormWithRedirect
214-
onSubmit={jest.fn()}
215-
render={() => {
216-
return (
217-
<Input
218-
source="views"
219-
resource="posts"
220-
initialValue={99}
221-
>
222-
{({ id, input }) => {
223-
return (
224-
<input
225-
type="number"
226-
id={id}
227-
aria-label="Views"
228-
{...input}
229-
/>
230-
);
231-
}}
232-
</Input>
233-
);
234-
}}
235-
/>
236-
</RecordContextProvider>
212+
<FormWithRedirect
213+
onSubmit={jest.fn()}
214+
record={{ id: 1, views: 0 }}
215+
render={() => {
216+
return (
217+
<Input
218+
source="views"
219+
resource="posts"
220+
initialValue={99}
221+
>
222+
{({ id, input }) => {
223+
return (
224+
<input
225+
type="number"
226+
id={id}
227+
aria-label="Views"
228+
{...input}
229+
/>
230+
);
231+
}}
232+
</Input>
233+
);
234+
}}
235+
/>
237236
);
238237
expect(queryByDisplayValue('99')).toBeNull();
239238
});

0 commit comments

Comments
 (0)