diff --git a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx index 354a283b09..64b8863fe6 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.jsx @@ -24,6 +24,7 @@ import ChipGroup from '../../ChipGroup'; const PromptTitle = styled(Title)` --pf-c-title--m-md--FontWeight: 700; + grid-column: 1 / -1; `; function ScheduleDetail({ schedule, i18n }) { @@ -140,7 +141,7 @@ function ScheduleDetail({ schedule, i18n }) { /> {showPromptedFields && ( <> - + {i18n._(t`Prompted Fields`)} diff --git a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.test.jsx b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.test.jsx index 4d78540b70..fe9175c6de 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.test.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleDetail/ScheduleDetail.test.jsx @@ -135,8 +135,8 @@ describe('', () => { expect(wrapper.find('Detail[label="Job Tags"]').length).toBe(0); expect(wrapper.find('Detail[label="Skip Tags"]').length).toBe(0); }); - test.skip('details should render with the proper values with prompts', async () => { - SchedulesAPI.readCredentials.mockResolvedValueOnce({ + test('details should render with the proper values with prompts', async () => { + SchedulesAPI.readCredentials.mockResolvedValue({ data: { count: 2, results: [ @@ -182,6 +182,7 @@ describe('', () => { ); }); await waitForElement(wrapper, 'ContentLoading', el => el.length === 0); + // await waitForElement(wrapper, 'Title', el => el.length > 0); expect( wrapper .find('Detail[label="Name"]') @@ -231,7 +232,7 @@ describe('', () => { expect(wrapper.find('Detail[label="Job Tags"]').length).toBe(1); expect(wrapper.find('Detail[label="Skip Tags"]').length).toBe(1); }); - test.skip('error shown when error encountered fetching credentials', async () => { + test('error shown when error encountered fetching credentials', async () => { SchedulesAPI.readCredentials.mockRejectedValueOnce( new Error({ response: { @@ -266,7 +267,7 @@ describe('', () => { await waitForElement(wrapper, 'ContentError', el => el.length === 1); }); - test.skip('should show edit button for users with edit permission', async () => { + test('should show edit button for users with edit permission', async () => { SchedulesAPI.readCredentials.mockResolvedValueOnce({ data: { count: 0, diff --git a/awx/ui_next/src/components/UserAndTeamAccessAdd/UserAndTeamAccessAdd.test.jsx b/awx/ui_next/src/components/UserAndTeamAccessAdd/UserAndTeamAccessAdd.test.jsx index 703d627402..b5f986c5db 100644 --- a/awx/ui_next/src/components/UserAndTeamAccessAdd/UserAndTeamAccessAdd.test.jsx +++ b/awx/ui_next/src/components/UserAndTeamAccessAdd/UserAndTeamAccessAdd.test.jsx @@ -11,7 +11,7 @@ jest.mock('../../api/models/Teams'); jest.mock('../../api/models/Users'); jest.mock('../../api/models/JobTemplates'); -describe.skip('', () => { +describe('', () => { const resources = { data: { results: [ @@ -56,6 +56,7 @@ describe.skip('', () => { /> ); }); + await waitForElement(wrapper, 'PFWizard'); }); afterEach(() => { wrapper.unmount(); @@ -68,12 +69,12 @@ describe.skip('', () => { expect(wrapper.find('Button[type="submit"]').prop('isDisabled')).toBe(true); expect( wrapper - .find('WizardNavItem[text="Select items from list"]') + .find('WizardNavItem[content="Select items from list"]') .prop('isDisabled') ).toBe(true); expect( wrapper - .find('WizardNavItem[text="Select roles to apply"]') + .find('WizardNavItem[content="Select roles to apply"]') .prop('isDisabled') ).toBe(true); await act(async () => @@ -89,17 +90,19 @@ describe.skip('', () => { wrapper.find('Button[type="submit"]').prop('onClick')() ); wrapper.update(); - expect( - wrapper.find('WizardNavItem[text="Add resource type"]').prop('isDisabled') - ).toBe(false); expect( wrapper - .find('WizardNavItem[text="Select items from list"]') + .find('WizardNavItem[content="Add resource type"]') .prop('isDisabled') ).toBe(false); expect( wrapper - .find('WizardNavItem[text="Select roles to apply"]') + .find('WizardNavItem[content="Select items from list"]') + .prop('isDisabled') + ).toBe(false); + expect( + wrapper + .find('WizardNavItem[content="Select roles to apply"]') .prop('isDisabled') ).toBe(true); }); diff --git a/awx/ui_next/src/screens/Application/ApplicationAdd/ApplicationAdd.test.jsx b/awx/ui_next/src/screens/Application/ApplicationAdd/ApplicationAdd.test.jsx index bcf39fe64c..2bc0eba47e 100644 --- a/awx/ui_next/src/screens/Application/ApplicationAdd/ApplicationAdd.test.jsx +++ b/awx/ui_next/src/screens/Application/ApplicationAdd/ApplicationAdd.test.jsx @@ -91,8 +91,8 @@ describe('', () => { wrapper.update(); expect(wrapper.find('input#name').prop('value')).toBe('new foo'); expect(wrapper.find('input#description').prop('value')).toBe('new bar'); - expect(wrapper.find('InnerChipGroup').length).toBe(1); - expect(wrapper.find('InnerChipGroup').text()).toBe('organization'); + expect(wrapper.find('Chip').length).toBe(1); + expect(wrapper.find('Chip').text()).toBe('organization'); expect( wrapper .find('AnsibleSelect[name="authorization_grant_type"]') diff --git a/awx/ui_next/src/screens/Application/shared/ApplicationForm.test.jsx b/awx/ui_next/src/screens/Application/shared/ApplicationForm.test.jsx index 406c3d5ace..f43fc878d2 100644 --- a/awx/ui_next/src/screens/Application/shared/ApplicationForm.test.jsx +++ b/awx/ui_next/src/screens/Application/shared/ApplicationForm.test.jsx @@ -107,8 +107,8 @@ describe(' { wrapper.update(); expect(wrapper.find('input#name').prop('value')).toBe('new foo'); expect(wrapper.find('input#description').prop('value')).toBe('new bar'); - expect(wrapper.find('InnerChipGroup').length).toBe(1); - expect(wrapper.find('InnerChipGroup').text()).toBe('organization'); + expect(wrapper.find('Chip').length).toBe(1); + expect(wrapper.find('Chip').text()).toBe('organization'); expect( wrapper .find('AnsibleSelect[name="authorization_grant_type"]') 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 c621971896..88a81eaf2c 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialForm.test.jsx @@ -190,7 +190,13 @@ describe('', () => { wrapper.find('textarea#credential-ssh_key_data').prop('value') ).toBe(''); }); - test.skip('should show error when error thrown parsing JSON', async () => { + test('should show error when error thrown parsing JSON', async () => { + await act(async () => { + await wrapper + .find('AnsibleSelect[id="credential_type"]') + .invoke('onChange')(null, 10); + }); + wrapper.update(); expect(wrapper.find('#credential-gce-file-helper').text()).toBe( 'Select a JSON formatted service account key to autopopulate the following fields.' ); @@ -201,7 +207,15 @@ describe('', () => { }); }); wrapper.update(); - expect(wrapper.find('#credential-gce-file-helper').text()).toBe( + expect( + wrapper.find('FormGroup[fieldId="credential-gce-file"]').prop('isValid') + ).toBe(false); + + expect( + wrapper + .find('FormGroup[fieldId="credential-gce-file"]') + .prop('helperTextInvalid') + ).toBe( 'There was an error parsing the file. Please check the file formatting and try again.' ); });