Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(KFLUXBUGS-1372): improve the label of private image repo #29

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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