diff --git a/apps/testing-nested/src/app/child.component.cy.ts b/apps/testing-nested/src/app/child.component.cy.ts index f18ab92..1f20b22 100644 --- a/apps/testing-nested/src/app/child.component.cy.ts +++ b/apps/testing-nested/src/app/child.component.cy.ts @@ -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(); + 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(); + }); }); - test('fail validating title because no title were typed', () => { - 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(); + }); }); }); diff --git a/apps/testing-nested/src/app/child.component.spec.ts b/apps/testing-nested/src/app/child.component.spec.ts index c7ffd3b..d03b6e5 100644 --- a/apps/testing-nested/src/app/child.component.spec.ts +++ b/apps/testing-nested/src/app/child.component.spec.ts @@ -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 () => { - await render(ChildComponent); + 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 () => { - await render(ChildComponent); + 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); + }); }); });