From bddbe126e860dbff89f092c7b85402be9e59bb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Po=C5=9Bpiech?= Date: Fri, 16 Feb 2024 09:05:49 +0100 Subject: [PATCH] refactor --- packages/uniforms-antd/__tests__/index.ts | 4 +++- packages/uniforms-material/__tests__/index.ts | 4 +++- packages/uniforms-mui/__tests__/index.ts | 4 +++- packages/uniforms/__suites__/ListItemField.tsx | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/uniforms-antd/__tests__/index.ts b/packages/uniforms-antd/__tests__/index.ts index 8438adb2e..9ced608fa 100644 --- a/packages/uniforms-antd/__tests__/index.ts +++ b/packages/uniforms-antd/__tests__/index.ts @@ -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); diff --git a/packages/uniforms-material/__tests__/index.ts b/packages/uniforms-material/__tests__/index.ts index 3e7aa4002..e3fb7bbdd 100644 --- a/packages/uniforms-material/__tests__/index.ts +++ b/packages/uniforms-material/__tests__/index.ts @@ -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); diff --git a/packages/uniforms-mui/__tests__/index.ts b/packages/uniforms-mui/__tests__/index.ts index ec4ed1087..281a1c0be 100644 --- a/packages/uniforms-mui/__tests__/index.ts +++ b/packages/uniforms-mui/__tests__/index.ts @@ -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); diff --git a/packages/uniforms/__suites__/ListItemField.tsx b/packages/uniforms/__suites__/ListItemField.tsx index bb52898db..0d0331744 100644 --- a/packages/uniforms/__suites__/ListItemField.tsx +++ b/packages/uniforms/__suites__/ListItemField.tsx @@ -7,7 +7,7 @@ import { renderWithZod } from './render-zod'; export function testListItemField( ListItemField: ComponentType, options?: { - useInputAsSelect?: boolean; + useInputAsSelectField?: boolean; }, ) { test(' - works', () => { @@ -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);