Skip to content

Commit

Permalink
feat(KFLUXBUGS-1372): improve the label of private image repo
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroPP committed Nov 27, 2024
1 parent dbe5454 commit 1fe0357
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const SourceSection = () => {
onChange={handleChange}
/>
{validated === ValidatedOptions.success ? (
<SwitchField name="isPrivateRepo" label="Is this a private repository?" />
<SwitchField name="isPrivateRepo" label="Should the image produced be private?" />
) : null}
{validated === ValidatedOptions.success ? <GitOptions /> : null}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(<ComponentSection />, {
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();
});
});
2 changes: 1 addition & 1 deletion src/components/ImportForm/__tests__/submit-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down

0 comments on commit 1fe0357

Please sign in to comment.