diff --git a/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts index 55c759e60a..c0dc284815 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/ng-model.component.spec.ts @@ -29,57 +29,35 @@ export class TestComponent extends AbstractNgModelComponent implements OnInit { } describe('AbstractNgModelComponent', () => { - let spectator: SpectatorHost; + let spectator: SpectatorHost; const createHost = createHostFactory({ component: TestComponent, declarations: [AbstractNgModelComponent], imports: [FormsModule], - detectChanges: false, }); - test('should pass the value with ngModel', done => { - spectator = createHost('', { + beforeEach(() => { + spectator = createHost('', { hostProps: { val: '1', + override: false, }, }); - - spectator.detectChanges(); - - timer(0).subscribe(() => { - expect(spectator.component.value).toBe('1'); - done(); - }); }); - test.skip('should set the value with ngModel', done => { - spectator = createHost('', { - hostProps: { - val: '2', - }, - }); - - spectator.detectChanges(); - + test('should pass the value with ngModel', done => { timer(0).subscribe(() => { - expect(spectator.hostComponent['val']).toBe('test'); + expect(spectator.component.value).toBe('1'); done(); }); }); - test.skip('should not change value when disable is true', done => { - spectator = createHost('', { - hostProps: { - val: '2', - }, - }); - - spectator.component['val'] = '3'; - spectator.detectChanges(); + test('should set the value with ngModel', done => { + spectator.setHostInput({ val: '2', override: true }); timer(0).subscribe(() => { - expect(spectator.hostComponent['val']).toBe('2'); + expect(spectator.hostComponent.val).toBe('test'); done(); }); });