Skip to content

Commit 5b36ddd

Browse files
committed
Fix broken tests after removing 'value' binding
1 parent af821fb commit 5b36ddd

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/app/component/create/create.component.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,23 @@ describe('CreateComponent', () => {
2929
['apply', 'cancel'].forEach((param) => {
3030
it(`should execute ${param}() method when ${param.toUpperCase()} button is clicked`, () => {
3131
const title = fixture.debugElement.query(
32-
By.css('#create-title')
32+
By.css('#create-title'),
3333
).nativeElement;
3434
const body = fixture.debugElement.query(
35-
By.css('#create-body')
35+
By.css('#create-body'),
3636
).nativeElement;
3737
const button = fixture.debugElement.query(
38-
By.css(`#create-${param}`)
38+
By.css(`#create-${param}`),
3939
).nativeElement;
4040

4141
spyOn(component, `${param}` as keyof CreateComponent);
4242

4343
component.title = 'Title';
4444
component.body = 'Body';
4545

46+
title.dispatchEvent(new Event('input'));
47+
body.dispatchEvent(new Event('input'));
48+
4649
fixture.detectChanges();
4750

4851
expect(component.title).toBe(title.value);
@@ -51,7 +54,7 @@ describe('CreateComponent', () => {
5154
button.click();
5255

5356
expect(
54-
param === 'apply' ? component.apply : component.cancel
57+
param === 'apply' ? component.apply : component.cancel,
5558
).toHaveBeenCalled();
5659
});
5760
});

0 commit comments

Comments
 (0)