-
Notifications
You must be signed in to change notification settings - Fork 5
WangKe's HW #5
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?
WangKe's HW #5
Conversation
lklgithub
left a comment
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
good code logic
comprehensive test coverage
need to better
add some test type message commit
| @@ -0,0 +1,19 @@ | |||
| <div> | |||
| <counter | |||
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.
good code style of writing such as define remove and reset event to receive counter id
| expect(component.counters[0].num).toEqual(0); | ||
| expect(component.counters[1].num).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.
suggest add remove test(give counters[2], to call RemoveCounterWithIndex())
| component.onReset(); | ||
|
|
||
| expect(component.counters[0].num).toEqual(0); | ||
| expect(component.counters[1].num).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.
well: nice to verify counters when test reset
| describe('CounterComponent', () => { | ||
| let component: CounterComponent; | ||
| let fixture: ComponentFixture<CounterComponent>; | ||
| //let groupComponent : CounterGroupComponent; |
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: remove dead code
| expect(component.number).toEqual(1); | ||
| }) | ||
|
|
||
| it('should be deleted when click the remove 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: this test is failed, we can try to move this feature to counter group
| @@ -0,0 +1,10 @@ | |||
| <div style="margin: 1px;"> | |||
| <button (click)="onIncreaseNumber()" class="btn btn-primary">Plus</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: maybe it's better to use + as button text, since it's more general
No description provided.