Skip to content

Conversation

@slb-bgc-wk
Copy link

No description provided.

Copy link

@lklgithub lklgithub left a 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

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);
})

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);

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;

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', () => {

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>

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

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