diff --git a/src/components/ImportForm/ComponentSection/SourceSection.tsx b/src/components/ImportForm/ComponentSection/SourceSection.tsx index f2d81a3..0425655 100644 --- a/src/components/ImportForm/ComponentSection/SourceSection.tsx +++ b/src/components/ImportForm/ComponentSection/SourceSection.tsx @@ -41,7 +41,7 @@ export const SourceSection = () => { onChange={handleChange} /> {validated === ValidatedOptions.success ? ( - + ) : null} {validated === ValidatedOptions.success ? : null} diff --git a/src/components/ImportForm/ComponentSection/__tests__/ComponentSection.spec.tsx b/src/components/ImportForm/ComponentSection/__tests__/ComponentSection.spec.tsx index 4de4b26..fe057b9 100644 --- a/src/components/ImportForm/ComponentSection/__tests__/ComponentSection.spec.tsx +++ b/src/components/ImportForm/ComponentSection/__tests__/ComponentSection.spec.tsx @@ -22,4 +22,19 @@ describe('ComponentSection', () => { await user.tab(); await waitFor(() => screen.getByText('Show advanced Git options')); }); + it('should get private image repo switch when git src is ready', async () => { + formikRenderer(, { + source: { git: { url: '' } }, + }); + const user = userEvent.setup(); + const source = screen.getByPlaceholderText('Enter your source'); + + await user.type(source, 'https://github.com/abcd/repo.git'); + await user.tab(); + + const switchCheckbox = screen.getByLabelText('Should the image produced be private?'); + expect(switchCheckbox).not.toBeChecked(); + await user.click(switchCheckbox); + expect(switchCheckbox).toBeChecked(); + }); }); diff --git a/src/components/ImportForm/__tests__/submit-utils.spec.ts b/src/components/ImportForm/__tests__/submit-utils.spec.ts index 2b6c315..6e2a21e 100644 --- a/src/components/ImportForm/__tests__/submit-utils.spec.ts +++ b/src/components/ImportForm/__tests__/submit-utils.spec.ts @@ -85,7 +85,7 @@ describe('Submit Utils: createResources', () => { application: 'test-app', inAppContext: true, showComponent: true, - isPrivateRepo: false, + isPrivateRepo: true, source: { git: { url: 'https://github.com/',