Skip to content

Commit 4b5ded4

Browse files
committed
feat(KFLUXBUGS-1372): improve the label of private image repo
1 parent 2d6db11 commit 4b5ded4

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/components/ImportForm/ComponentSection/SourceSection.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const SourceSection = () => {
4141
onChange={handleChange}
4242
/>
4343
{validated === ValidatedOptions.success ? (
44-
<SwitchField name="isPrivateRepo" label="Is this a private repository?" />
44+
<SwitchField name="isPrivateRepo" label="Should the image produced be private?" />
4545
) : null}
4646
{validated === ValidatedOptions.success ? <GitOptions /> : null}
4747
</>

src/components/ImportForm/ComponentSection/__tests__/ComponentSection.spec.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,19 @@ describe('ComponentSection', () => {
2222
await user.tab();
2323
await waitFor(() => screen.getByText('Show advanced Git options'));
2424
});
25+
it('should get private image repo switch when git src is ready', async () => {
26+
formikRenderer(<ComponentSection />, {
27+
source: { git: { url: '' } },
28+
});
29+
const user = userEvent.setup();
30+
const source = screen.getByPlaceholderText('Enter your source');
31+
32+
await user.type(source, 'https://github.com/abcd/repo.git');
33+
await user.tab();
34+
35+
const switchCheckbox = screen.getByLabelText('Should the image produced be private?');
36+
expect(switchCheckbox).not.toBeChecked();
37+
await user.click(switchCheckbox);
38+
expect(switchCheckbox).toBeChecked();
39+
});
2540
});

src/components/ImportForm/__tests__/submit-utils.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('Submit Utils: createResources', () => {
8585
application: 'test-app',
8686
inAppContext: true,
8787
showComponent: true,
88-
isPrivateRepo: false,
88+
isPrivateRepo: true,
8989
source: {
9090
git: {
9191
url: 'https://github.com/',

0 commit comments

Comments
 (0)