Skip to content

Commit

Permalink
fix(KFLUXBUGS-96): make the secret forms more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroPP committed Nov 25, 2024
1 parent b082a43 commit a436684
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/Secrets/SecretForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const SecretForm: React.FC<React.PropsWithChildren<SecretFormProps>> = ({ existi
required
key={values.type}
name="secretName"
label="Select or enter name"
label="Select or enter secret name"
helpText="Unique name of the new secret."
isCreatable
isInputValuePersisted
Expand Down
5 changes: 2 additions & 3 deletions src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ export const SecretTypeSubForm: React.FC<React.PropsWithChildren<unknown>> = ()
{isPartnerTaskAvailable(currentTypeRef.current) ? (
<SelectInputField
name="name"
label="Secret name"
toggleAriaLabel="Secret name"
label="Select or enter secret name"
toggleAriaLabel="Select or enter secret name"
helpText="Unique name of the new secret"
toggleId="secret-name-toggle"
placeholderText="Enter name"
variant={SelectVariant.typeahead}
options={options}
isCreatable
Expand Down
2 changes: 1 addition & 1 deletion src/components/Secrets/__tests___/AddSecretForm.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('AddSecretForm', () => {

await waitFor(() => {
screen.getByText('Secret type');
screen.getByText('Secret name');
screen.getByText('Select or enter secret name');
screen.getByText('Labels');
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/Secrets/__tests___/SecretTypeSubForm.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('SecretTypeSubForm', () => {

it('should render Secret type sub form and fields', () => {
expect(screen.getByText('Secret type')).toBeVisible();
expect(screen.getByText('Secret name')).toBeVisible();
expect(screen.getByText('Select or enter secret name')).toBeVisible();
});

it('should render subforms correctly for specified targets', async () => {
Expand All @@ -57,8 +57,8 @@ describe('SecretTypeSubForm', () => {
});

it('should render correct variant of name field', () => {
expect(screen.getByRole('button', { name: 'Secret name' })).toBeVisible();
fireEvent.click(screen.getByRole('button', { name: 'Secret name' }));
expect(screen.getByRole('button', { name: 'Select or enter secret name' })).toBeVisible();
fireEvent.click(screen.getByRole('button', { name: 'Select or enter secret name' }));
expect(screen.getByText('snyk-secret')).toBeVisible();
});
});

0 comments on commit a436684

Please sign in to comment.