From e6e79227e5c74a4262fe3e6166904863b68b7745 Mon Sep 17 00:00:00 2001 From: mabashian Date: Tue, 28 Jul 2020 11:26:48 -0400 Subject: [PATCH] Fixes console errors thrown about isValid on the credential form --- .../screens/Credential/shared/CredentialForm.test.jsx | 6 ++++-- .../shared/CredentialFormFields/BecomeMethodField.jsx | 2 +- .../shared/CredentialFormFields/CredentialField.jsx | 11 +++++------ .../CredentialPlugins/CredentialPluginField.jsx | 4 ++-- .../CredentialFormFields/GceFileUploadField.jsx | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx index 88a81eaf2c..d23e5347ee 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx @@ -208,8 +208,10 @@ describe('', () => { }); wrapper.update(); expect( - wrapper.find('FormGroup[fieldId="credential-gce-file"]').prop('isValid') - ).toBe(false); + wrapper + .find('FormGroup[fieldId="credential-gce-file"]') + .prop('validated') + ).toBe('error'); expect( wrapper diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialFormFields/BecomeMethodField.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialFormFields/BecomeMethodField.jsx index 1c2577e83d..fb51b1f4c6 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialFormFields/BecomeMethodField.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialFormFields/BecomeMethodField.jsx @@ -41,7 +41,7 @@ function BecomeMethodField({ fieldOptions, isRequired }) { ) } isRequired={isRequired} - isValid={!(meta.touched && meta.error)} + validated={!(meta.touched && meta.error) ? 'default' : 'error'} >