From 54432b1c3fecc2842e95ec3c6124478eb24f164c Mon Sep 17 00:00:00 2001 From: Wendell Date: Tue, 12 Mar 2019 23:05:05 +0800 Subject: [PATCH] fix: specs --- components/input-number/nz-input-number.spec.ts | 2 +- components/modal/nz-modal.component.ts | 2 +- components/modal/nz-modal.spec.ts | 2 ++ components/test.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/input-number/nz-input-number.spec.ts b/components/input-number/nz-input-number.spec.ts index 71c57ab21cb..b255c6a79f2 100644 --- a/components/input-number/nz-input-number.spec.ts +++ b/components/input-number/nz-input-number.spec.ts @@ -475,7 +475,7 @@ export class NzTestInputNumberBasicComponent { placeholder = 'placeholder'; step = 1; precision?: number = 2; - formatter = (value: number) => `${value}`; + formatter = (value: number) => value !== null ? `${value}` : ''; parser = (value: number) => value; modelChange = jasmine.createSpy('change callback'); } diff --git a/components/modal/nz-modal.component.ts b/components/modal/nz-modal.component.ts index 5758499754a..220d789d38e 100644 --- a/components/modal/nz-modal.component.ts +++ b/components/modal/nz-modal.component.ts @@ -314,7 +314,7 @@ export class NzModalComponent extends NzModalRef impleme } return Promise - .resolve(() => animation ? this.animateTo(visible) : undefined) + .resolve(animation ? this.animateTo(visible) : undefined) .then(() => { // Emit open/close event after animations over if (visible) { this.nzAfterOpen.emit(); diff --git a/components/modal/nz-modal.spec.ts b/components/modal/nz-modal.spec.ts index 284b6f10004..5847bb43623 100644 --- a/components/modal/nz-modal.spec.ts +++ b/components/modal/nz-modal.spec.ts @@ -140,6 +140,8 @@ describe('modal testing (legacy)', () => { }); it('should correctly render all basic props', fakeAsync(() => { + spyOn(console, 'log'); + // [Hack] Codes that can't be covered by normal operations // @ts-ignore expect(modalInstance.changeVisibleFromInside(true) instanceof Promise).toBe(true); diff --git a/components/test.ts b/components/test.ts index 16317897b1c..79d6864a173 100644 --- a/components/test.ts +++ b/components/test.ts @@ -15,6 +15,6 @@ getTestBed().initTestEnvironment( platformBrowserDynamicTesting() ); // Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); +const context = require.context('./', true, /nz-input-number\.spec\.ts$/); // And load the modules. context.keys().map(context);