Skip to content

Conversation

@celianiu
Copy link

@celianiu celianiu commented Nov 9, 2023

No description provided.

@mechcodeman
Copy link

well

  • all ACs complete.
  • component design rationalization, input and output methods.
  • Typically correct communication between components.

to be improved

  • remove method can use easier way, using a div element to wrap the counter component and add a button in, move the *ngFor to div layer.


it('should delete a counter when onDeleteCounter when given valid id', () => {
component.onDeleteCounter(firstCounterId);
expect(component.counters.length).toEqual(4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: not only test count, but also test data in counters

component.onReset();
expect(component.counterSum).toEqual(0);
component.counters.forEach(counter => [
expect(counter.num).toEqual(0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well: nice to verify num of each counter

expect(component.isShowDecreaseButton).toBeTruthy();
});

it('should isShouldDecrease to be false when number < 0', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well: nice to cover so many cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants