Skip to content

Commit

Permalink
InputGuesser: fix array label and test
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Jul 8, 2024
1 parent 061b5c9 commit e12cd7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/InputGuesser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,8 @@ describe('<InputGuesser />', () => {
'resources.users.fields.embedded',
);
expect(embeddedField).toHaveValue('{"address":"91 rue du Temple"}');
expect(
await screen.findAllByText('resources.users.fields.embeddeds.0'),
).toHaveLength(1);
const embeddedsField = screen.getByLabelText(
'resources.users.fields.embeddeds.0',
const embeddedsField = await screen.findByLabelText(
'resources.users.fields.embeddeds',
);
expect(embeddedsField).toHaveValue('{"address":"16 avenue de Rivoli"}');

Expand Down
1 change: 1 addition & 0 deletions src/InputGuesser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export const IntrospectedInputGuesser = ({
<SimpleFormIterator>
<TextInput
source=""
label={`resources.${props.resource}.fields.${field.name}`}
format={formatProp ?? format}
parse={parseProp ?? parse}
/>
Expand Down

0 comments on commit e12cd7f

Please sign in to comment.