-
Notifications
You must be signed in to change notification settings - Fork 5
CounterStuffByWangJing #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| {num: 3} | ||
| ] | ||
|
|
||
| get sum(){ |
There was a problem hiding this comment.
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
|
WangKe: Suggestions:
|
| @@ -0,0 +1,11 @@ | |||
| <button (click)="onAdd()">Add counter</button> | |||
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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}]) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
No description provided.