Skip to content

Commit 5c30249

Browse files
author
ThomasL
committed
refactor(challenge19): clarify test
1 parent 43b8e3f commit 5c30249

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { CounterComponent } from './counter.component';
22

33
describe(CounterComponent.name, () => {
4-
it('using createOutputSpy', () => {
5-
cy.mount(CounterComponent);
6-
});
4+
describe('Given an initualValue of 10', async () => {
5+
it('listen to output using createOutputSpy', () => {
6+
cy.mount(CounterComponent);
7+
});
78

8-
it('using autoSpyOutputs', () => {
9-
cy.mount(CounterComponent);
9+
it('listen to output using autoSpyOutputs', () => {
10+
cy.mount(CounterComponent);
11+
});
1012
});
1113
});

apps/testing-input-output/src/app/counter.component.spec.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@ import { render } from '@testing-library/angular';
22
import { CounterComponent } from './counter.component';
33

44
describe('CounterComponent', () => {
5-
test('set input and listen to output', async () => {
6-
await render(CounterComponent);
5+
describe('Given an initualValue of 10', async () => {
6+
test('Then counterValue is 10', async () => {
7+
await render(CounterComponent);
8+
});
9+
10+
describe('When clicking 5 times on increment button', async () => {
11+
test('Then counterValue is 15', async () => {
12+
await render(CounterComponent);
13+
});
14+
});
15+
16+
describe('When clicking 2 times on decrement button', async () => {
17+
test('Then counterValue is 8', async () => {
18+
await render(CounterComponent);
19+
});
20+
describe('When clicking on Send ', async () => {
21+
test('Then emitted value is 8', async () => {
22+
await render(CounterComponent);
23+
});
24+
});
25+
});
726
});
827
});

0 commit comments

Comments
 (0)