diff --git a/ui/src/components/EntityModal/EntityModal.test.tsx b/ui/src/components/EntityModal/EntityModal.test.tsx index c18ddf671..1a7f3c867 100644 --- a/ui/src/components/EntityModal/EntityModal.test.tsx +++ b/ui/src/components/EntityModal/EntityModal.test.tsx @@ -62,7 +62,8 @@ describe('Oauth field disabled on edit - diableonEdit property', () => { renderModalWithProps(props); const oauthTextBox = getDisabledOauthField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).not.toHaveAttribute('disabled'); + expect(oauthTextBox).not.toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('false'); }); it('Oauth Oauth - disableonEdit = true, oauth field disabled on edit', async () => { @@ -82,7 +83,8 @@ describe('Oauth field disabled on edit - diableonEdit property', () => { const oauthTextBox = getDisabledOauthField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).toHaveAttribute('disabled'); + expect(oauthTextBox).toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('true'); }); it('Oauth Basic - Enable field equal false, so field disabled', async () => { @@ -102,7 +104,8 @@ describe('Oauth field disabled on edit - diableonEdit property', () => { const oauthTextBox = getDisabledBasicField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).toHaveAttribute('disabled'); + expect(oauthTextBox).toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('true'); }); it('if oauth field not disabled with create after disableonEdit true', async () => { @@ -120,7 +123,8 @@ describe('Oauth field disabled on edit - diableonEdit property', () => { renderModalWithProps(props); const oauthTextBox = getDisabledBasicField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).not.toHaveAttribute('disabled'); + expect(oauthTextBox).not.toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('false'); }); }); @@ -163,7 +167,8 @@ describe('Options - Enable field property', () => { renderModalWithProps(props); const oauthTextBox = getDisabledOauthField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).toHaveAttribute('disabled'); + expect(oauthTextBox).toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('true'); }); it('Oauth Basic - Enable field equal false, so field disabled', async () => { @@ -181,7 +186,8 @@ describe('Options - Enable field property', () => { renderModalWithProps(props); const oauthTextBox = getDisabledOauthField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).toHaveAttribute('disabled'); + expect(oauthTextBox).toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('true'); }); it('Oauth Basic - Fully enabled field, enabled: true, disableonEdit: false', async () => { @@ -199,7 +205,8 @@ describe('Options - Enable field property', () => { renderModalWithProps(props); const oauthTextBox = getDisabledOauthField(); expect(oauthTextBox).toBeInTheDocument(); - expect(oauthTextBox).not.toHaveAttribute('disabled'); + expect(oauthTextBox).not.toHaveAttribute('readonly'); + expect(oauthTextBox?.getAttribute('aria-disabled')).toBe('false'); }); }); diff --git a/ui/src/components/FormModifications/FormModifications.test.tsx b/ui/src/components/FormModifications/FormModifications.test.tsx index 5a0f21d12..697cc714e 100644 --- a/ui/src/components/FormModifications/FormModifications.test.tsx +++ b/ui/src/components/FormModifications/FormModifications.test.tsx @@ -127,18 +127,22 @@ it('verify modification after text components change', async () => { expect(parentElement).toHaveTextContent(mods.label); }; - expect(componentInput).toBeDisabled(); + expect(componentInput).toHaveAttribute('readonly'); + expect(componentInput.getAttribute('aria-disabled')).toBe('true'); verifyAllProps(componentParentElement, componentInput, mods1Field1); - expect(component2Input).toBeDisabled(); + expect(component2Input).toHaveAttribute('readonly'); + expect(component2Input.getAttribute('aria-disabled')).toBe('true'); verifyAllProps(component2ParentElement, component2Input, mods1Field2); await userEvent.type(componentMakingModsTextBox1, secondValueToInput); - expect(componentInput).toBeEnabled(); + expect(componentInput).not.toHaveAttribute('readonly'); + expect(componentInput.getAttribute('aria-disabled')).toBe('false'); verifyAllProps(componentParentElement, componentInput, mods2Field1); - expect(component2Input).toBeEnabled(); + expect(component2Input).not.toHaveAttribute('readonly'); + expect(component2Input.getAttribute('aria-disabled')).toBe('false'); verifyAllProps(component2ParentElement, component2Input, mods2Field2); });