From ef866795632ab6e145db1b2c97caa679da5253bb Mon Sep 17 00:00:00 2001 From: KingMario Date: Wed, 12 Jun 2024 16:46:32 +0800 Subject: [PATCH] chore: update formTests --- packages/snapshot-tests/src/formTests.tsx | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/snapshot-tests/src/formTests.tsx b/packages/snapshot-tests/src/formTests.tsx index 4ffa74c13b..70b4dd47e0 100644 --- a/packages/snapshot-tests/src/formTests.tsx +++ b/packages/snapshot-tests/src/formTests.tsx @@ -209,6 +209,18 @@ export function formTests(Form: ComponentType, customOptions: FormRen const tree = renderer.create(
).toJSON(); expect(tree).toMatchSnapshot(); }); + test('select field single choice enumDisabled using radio widget', () => { + const schema: RJSFSchema = { + type: 'string', + enum: ['foo', 'bar'], + }; + const uiSchema = { + 'ui:widget': 'radio', + 'ui:enumDisabled': ['bar'], + }; + const tree = renderer.create().toJSON(); + expect(tree).toMatchSnapshot(); + }); test('select field multiple choice enumDisabled', () => { const schema: RJSFSchema = { type: 'array', @@ -226,6 +238,24 @@ export function formTests(Form: ComponentType, customOptions: FormRen .toJSON(); expect(tree).toMatchSnapshot(); }); + test('select field multiple choice enumDisabled using checkboxes', () => { + const schema: RJSFSchema = { + type: 'array', + items: { + type: 'string', + enum: ['foo', 'bar', 'fuzz', 'qux'], + }, + uniqueItems: true, + }; + const uiSchema = { + 'ui:widget': 'checkboxes', + 'ui:enumDisabled': ['bar'], + }; + const tree = renderer + .create(, customOptions.selectMulti) + .toJSON(); + expect(tree).toMatchSnapshot(); + }); test('select field single choice formData', () => { const schema: RJSFSchema = { type: 'string',