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>
This commit is contained in:
Roman Zabaluev 2022-03-31 19:53:25 +04:00 committed by GitHub
parent cb7627d8df
commit e113e36348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

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

View file

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

View file

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