Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpospiech committed Feb 16, 2024
1 parent c37de07 commit bddbe12
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/uniforms-antd/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ describe('@RTL', () => {
suites.testListField(theme.ListField, {
getListAddField: screen => screen.getByRole('img', { name: 'plus-square' }),
});
suites.testListItemField(theme.ListItemField, { useInputAsSelect: true });
suites.testListItemField(theme.ListItemField, {
useInputAsSelectField: true,
});
suites.testLongTextField(theme.LongTextField);
// FIXME: AntD number input doesn't work with new RTL test implementation
// suites.testNumField(antd.NumField);
Expand Down
4 changes: 3 additions & 1 deletion packages/uniforms-material/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ describe('@RTL', () => {
suites.testListField(theme.ListField, {
getListAddField: screen => screen.getByText(/\+/),
});
suites.testListItemField(theme.ListItemField, { useInputAsSelect: true });
suites.testListItemField(theme.ListItemField, {
useInputAsSelectField: true,
});
suites.testLongTextField(theme.LongTextField);
suites.testNestField(theme.NestField, { skipInMuiTests: true });
suites.testNumField(theme.NumField);
Expand Down
4 changes: 3 additions & 1 deletion packages/uniforms-mui/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ describe('@RTL', () => {
suites.testListField(theme.ListField, {
getListAddField: screen => screen.getByText(/\+/),
});
suites.testListItemField(theme.ListItemField, { useInputAsSelect: true });
suites.testListItemField(theme.ListItemField, {
useInputAsSelectField: true,
});
suites.testLongTextField(theme.LongTextField);
suites.testNestField(theme.NestField, { skipInMuiTests: true });
suites.testNumField(theme.NumField);
Expand Down
4 changes: 2 additions & 2 deletions packages/uniforms/__suites__/ListItemField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { renderWithZod } from './render-zod';
export function testListItemField(
ListItemField: ComponentType<any>,
options?: {
useInputAsSelect?: boolean;
useInputAsSelectField?: boolean;
},
) {
test('<ListItemField> - works', () => {
Expand Down Expand Up @@ -44,7 +44,7 @@ export function testListItemField(
}),
});

if (options?.useInputAsSelect) {
if (options?.useInputAsSelectField) {
expect(container.getElementsByTagName('input')).toHaveLength(3);
} else {
expect(container.getElementsByTagName('input')).toHaveLength(2);
Expand Down

0 comments on commit bddbe12

Please sign in to comment.