Skip to content

Conversation

@jingwang315
Copy link

No description provided.

@jingwang315 jingwang315 changed the title CounterStuf CounterStuffByWangJing Nov 9, 2023
{num: 3}
]

get sum(){

Choose a reason for hiding this comment

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

WangKe:
The Sum() method also need to be tested

@slb-bgc-wk
Copy link

WangKe:
Goods:
1.All ACs requirements are meet.
2.Move the Delete button to counter-group
3.Components covered by tests

Suggestions:

  1. It would be better if all methods were covered by tests

@@ -0,0 +1,11 @@
<button (click)="onAdd()">Add counter</button>

Choose a reason for hiding this comment

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

suggestion: add "Counter Group" title on top of "Add counter" button


<div *ngFor="let counter of counters; index as i;">
<app-counter [number]="counter.num" (change)="counter.num = $event"> </app-counter>
<button (click)="onDelete(i)">Delete</button>

Choose a reason for hiding this comment

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

suggestion: rename this button to Remove instead of Delete, to keep the same name with requirement.

it('should remove a counter when call onDelete', ()=>{
component.counters = [{num:1},{num:0}]
component.onDelete(0)
expect(component.counters).toEqual([{num:0}])

Choose a reason for hiding this comment

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

well: verify counters when test remove feature

component.onResetAll()
component.counters.forEach(element =>
expect(element.num).toEqual(0))
expect(component.sum).toEqual(0)

Choose a reason for hiding this comment

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

suggestion: verify for sum should be in another test, this test for reset feature only need verify counters change

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