mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
refactor(challenge18): clarify test
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { ChildComponent } from './child.component';
|
||||
|
||||
describe(ChildComponent.name, () => {
|
||||
describe('ChildComponent', () => {
|
||||
const setup = () => {
|
||||
cy.mount(ChildComponent);
|
||||
};
|
||||
|
||||
test('add Good title and send request title with no error', () => {
|
||||
setup();
|
||||
});
|
||||
|
||||
test('fail validating title because no title were typed', () => {
|
||||
describe('When typing nothing and clicking on Validate', () => {
|
||||
test('Then show "Title is required" error message and no http request has been sent', async () => {
|
||||
setup();
|
||||
});
|
||||
});
|
||||
|
||||
describe('When typing "Good" and clicking on Validate', () => {
|
||||
test('Then show "Title is Good" message, no error message and send a http request to the backend', async () => {
|
||||
setup();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,11 +2,15 @@ import { render } from '@testing-library/angular';
|
||||
import { ChildComponent } from './child.component';
|
||||
|
||||
describe('ChildComponent', () => {
|
||||
test('add Good title and send request title with no error', async () => {
|
||||
describe('When typing nothing and clicking on Validate', () => {
|
||||
test('Then show "Title is required" error message and no http request has been sent', async () => {
|
||||
await render(ChildComponent);
|
||||
});
|
||||
});
|
||||
|
||||
test('fail validating title because no title were typed', async () => {
|
||||
describe('When typing "Good" and clicking on Validate', () => {
|
||||
test('Then show "Title is Good" message, no error message and send a http request to the backend', async () => {
|
||||
await render(ChildComponent);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user