Преглед на файлове

Rename 'send' button to 'submit' (#1770)

* Rename 'send' button to 'submit'

Signed-off-by: Roman Zabaluev <rzabaluev@provectus.com>

* fix the New spec test file for submit button name

Co-authored-by: Mgrdich <mgotm13@gmail.com>
Roman Zabaluev преди 3 години
родител
ревизия
e113e36348

+ 2 - 2
kafka-ui-react-app/src/components/Topics/New/__test__/New.spec.tsx

@@ -50,7 +50,7 @@ describe('New', () => {
     renderComponent(mockedHistory);
 
     await waitFor(() => {
-      userEvent.click(screen.getByText('Send'));
+      userEvent.click(screen.getByText(/submit/i));
     });
     await waitFor(() => {
       expect(screen.getByText('name is a required field')).toBeInTheDocument();
@@ -76,7 +76,7 @@ describe('New', () => {
 
     await waitFor(() => {
       userEvent.type(screen.getByPlaceholderText('Topic Name'), topicName);
-      userEvent.click(screen.getByText('Send'));
+      userEvent.click(screen.getByText(/submit/i));
     });
 
     await waitFor(() =>

+ 1 - 1
kafka-ui-react-app/src/components/Topics/shared/Form/TopicForm.tsx

@@ -198,7 +198,7 @@ const TopicForm: React.FC<Props> = ({
         <CustomParamsContainer isSubmitting={isSubmitting} />
 
         <Button type="submit" buttonType="primary" buttonSize="L">
-          Send
+          Submit
         </Button>
       </fieldset>
     </StyledForm>

+ 2 - 2
kafka-ui-react-app/src/components/Topics/shared/Form/__tests__/TopicForm.spec.tsx

@@ -57,7 +57,7 @@ describe('TopicForm', () => {
 
     expectByRoleAndNameToBeInDocument('heading', 'Custom parameters');
 
-    expectByRoleAndNameToBeInDocument('button', 'Send');
+    expectByRoleAndNameToBeInDocument('button', 'Submit');
   });
 
   it('submits', () => {
@@ -66,7 +66,7 @@ describe('TopicForm', () => {
       onSubmit: onSubmit.mockImplementation((e) => e.preventDefault()),
     });
 
-    userEvent.click(screen.getByRole('button', { name: 'Send' }));
+    userEvent.click(screen.getByRole('button', { name: 'Submit' }));
     expect(onSubmit).toBeCalledTimes(1);
   });
 });