diff --git a/packages/dm-core-plugins/src/form/fields/BooleanField/BooleanField.test.tsx b/packages/dm-core-plugins/src/form/fields/BooleanField/BooleanField.test.tsx index a6a7799c8..12ff7d71c 100644 --- a/packages/dm-core-plugins/src/form/fields/BooleanField/BooleanField.test.tsx +++ b/packages/dm-core-plugins/src/form/fields/BooleanField/BooleanField.test.tsx @@ -141,7 +141,7 @@ describe('BooleanField', () => { const inputNode: Element | null = container.querySelector(` input[id="foo"]`) expect(inputNode).toBeDefined() - const value = inputNode !== null ? inputNode.getAttribute('checked') : '' + const value = inputNode !== null ? inputNode.getAttribute('data-test-checked') : '' expect(value).toBe('true') }) @@ -170,7 +170,7 @@ describe('BooleanField', () => { const inputNode: Element | null = container.querySelector(` input[id="foo"]`) expect(inputNode).toBeDefined() - const value = inputNode !== null ? inputNode.getAttribute('checked') : '' + const value = inputNode !== null ? inputNode.getAttribute('data-test-checked') : '' expect(value).toBe('true') userEvent.click(screen.getByTestId('form-checkbox')) fireEvent.click(screen.getByTestId('form-submit')) diff --git a/packages/dm-core-plugins/src/form/fields/ObjectField/ObjectField.test.tsx b/packages/dm-core-plugins/src/form/fields/ObjectField/ObjectField.test.tsx index 941046667..956d30f4d 100644 --- a/packages/dm-core-plugins/src/form/fields/ObjectField/ObjectField.test.tsx +++ b/packages/dm-core-plugins/src/form/fields/ObjectField/ObjectField.test.tsx @@ -79,7 +79,7 @@ test('should show foo after bar if order states it', async () => { test('should handle a default object value', async () => { const utils = await setupSimple({ idReference: 'ds/$1', type: 'MyBlueprint' }) expect(utils.fooInput.getAttribute('value')).toBe('beep') - expect(utils.barInput.getAttribute('value')).toBe('false') + expect(utils.barInput.getAttribute('data-test-checked')).toBe('false') }) test('should handle object fields change events', async () => { diff --git a/packages/dm-core-plugins/src/form/widgets/CheckboxWidget.tsx b/packages/dm-core-plugins/src/form/widgets/CheckboxWidget.tsx index 460a65107..47d3e636d 100644 --- a/packages/dm-core-plugins/src/form/widgets/CheckboxWidget.tsx +++ b/packages/dm-core-plugins/src/form/widgets/CheckboxWidget.tsx @@ -11,7 +11,7 @@ const CheckboxWidget = (props: TWidget) => { ref={inputRef} disabled={readOnly} checked={value !== undefined ? value : false} - type='checkbox' + data-test-checked={value !== undefined ? value : false} data-testid='form-checkbox' />