refactor(challenge19): clarify test

This commit is contained in:
ThomasL
2023-07-13 15:28:13 +02:00
parent 43b8e3f968
commit 5c30249fb4
2 changed files with 28 additions and 7 deletions

View File

@@ -1,11 +1,13 @@
import { CounterComponent } from './counter.component'; import { CounterComponent } from './counter.component';
describe(CounterComponent.name, () => { describe(CounterComponent.name, () => {
it('using createOutputSpy', () => { describe('Given an initualValue of 10', async () => {
it('listen to output using createOutputSpy', () => {
cy.mount(CounterComponent); cy.mount(CounterComponent);
}); });
it('using autoSpyOutputs', () => { it('listen to output using autoSpyOutputs', () => {
cy.mount(CounterComponent); cy.mount(CounterComponent);
}); });
});
}); });

View File

@@ -2,7 +2,26 @@ import { render } from '@testing-library/angular';
import { CounterComponent } from './counter.component'; import { CounterComponent } from './counter.component';
describe('CounterComponent', () => { describe('CounterComponent', () => {
test('set input and listen to output', async () => { describe('Given an initualValue of 10', async () => {
test('Then counterValue is 10', async () => {
await render(CounterComponent); await render(CounterComponent);
}); });
describe('When clicking 5 times on increment button', async () => {
test('Then counterValue is 15', async () => {
await render(CounterComponent);
});
});
describe('When clicking 2 times on decrement button', async () => {
test('Then counterValue is 8', async () => {
await render(CounterComponent);
});
describe('When clicking on Send ', async () => {
test('Then emitted value is 8', async () => {
await render(CounterComponent);
});
});
});
});
}); });