From a4366842b4e6ef43caaf65c34a91dde8c5bf7f66 Mon Sep 17 00:00:00 2001 From: Joao Pedro Poloni Ponce Date: Tue, 12 Nov 2024 17:40:11 -0300 Subject: [PATCH] fix(KFLUXBUGS-96): make the secret forms more clear --- src/components/Secrets/SecretForm.tsx | 2 +- src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx | 5 ++--- src/components/Secrets/__tests___/AddSecretForm.spec.tsx | 2 +- .../Secrets/__tests___/SecretTypeSubForm.spec.tsx | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/Secrets/SecretForm.tsx b/src/components/Secrets/SecretForm.tsx index 25fda5e..543ae30 100644 --- a/src/components/Secrets/SecretForm.tsx +++ b/src/components/Secrets/SecretForm.tsx @@ -71,7 +71,7 @@ const SecretForm: React.FC> = ({ 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 diff --git a/src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx b/src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx index f3a5712..7926d7c 100644 --- a/src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx +++ b/src/components/Secrets/SecretsForm/SecretTypeSubForm.tsx @@ -116,11 +116,10 @@ export const SecretTypeSubForm: React.FC> = () {isPartnerTaskAvailable(currentTypeRef.current) ? ( { await waitFor(() => { screen.getByText('Secret type'); - screen.getByText('Secret name'); + screen.getByText('Select or enter secret name'); screen.getByText('Labels'); }); }); diff --git a/src/components/Secrets/__tests___/SecretTypeSubForm.spec.tsx b/src/components/Secrets/__tests___/SecretTypeSubForm.spec.tsx index f16a2be..269ef04 100644 --- a/src/components/Secrets/__tests___/SecretTypeSubForm.spec.tsx +++ b/src/components/Secrets/__tests___/SecretTypeSubForm.spec.tsx @@ -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 () => { @@ -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(); }); });