Skip to content

Commit

Permalink
feat(module: all): support Angular 11 (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge committed Dec 31, 2020
1 parent d798cc9 commit 7917100
Show file tree
Hide file tree
Showing 56 changed files with 165 additions and 162 deletions.
1 change: 0 additions & 1 deletion angular.json
Expand Up @@ -50,7 +50,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": false,
"vendorChunk": false,
Expand Down
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AccordionService } from '../accordion.service';
import { AccordionGroupComponent } from './accordion-group.component';
Expand All @@ -8,7 +8,7 @@ describe('AccordionGroupComponent', () => {
let component: AccordionGroupComponent;
let fixture: ComponentFixture<AccordionGroupComponent>;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AccordionGroupComponent],
imports: [BrowserAnimationsModule, NgZorroAntdMobilePipesModule],
Expand Down
4 changes: 2 additions & 2 deletions components/accordion/accordion.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild, OnInit } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, fakeAsync, tick, TestBed } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, tick, TestBed, waitForAsync } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AccordionModule } from './accordion.module';
import { AccordionComponent } from './accordion.component';
Expand All @@ -12,7 +12,7 @@ describe('AccordionComponent', () => {
let fixture: ComponentFixture<TestAccordionComponent>;
let accordionEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestAccordionComponent],
imports: [BrowserAnimationsModule, AccordionModule, WhiteSpaceModule],
Expand Down
4 changes: 2 additions & 2 deletions components/action-sheet/action-sheet.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed, fakeAsync, flush } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, flush, waitForAsync } from '@angular/core/testing';
import { ActionSheetComponent } from './action-sheet.component';
import { ActionSheet, ActionSheetModule, ButtonModule, ActionSheetRef } from '../..';
import { NgZorroAntdMobilePipesModule } from '../pipes/ng-zorro-antd-mobile.pipes.module';
Expand All @@ -12,7 +12,7 @@ describe('ActionSheetComponent', () => {
let buttons;
let actionSheetEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestActionSheetBasicComponent],
imports: [NgZorroAntdMobilePipesModule, ActionSheetModule, ButtonModule],
Expand Down
@@ -1,13 +1,13 @@
import { Component, OnDestroy } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, TestBed } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { ActivityIndicatorModule } from './activity-indicator.module';

describe('activity-indicator', () => {
let component;
let fixture;
let activityEle;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestActivityIndicatorComponent],
imports: [ActivityIndicatorModule]
Expand Down
4 changes: 2 additions & 2 deletions components/badge/badge.component.spec.ts
@@ -1,13 +1,13 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BadgeModule } from './badge.module';

describe('BadgeComponent', () => {
let component: TestBadgeComponent;
let fixture: ComponentFixture<TestBadgeComponent>;
let badgeEle;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestBadgeComponent],
imports: [BadgeModule]
Expand Down
4 changes: 2 additions & 2 deletions components/button/button.component.spec.ts
@@ -1,7 +1,7 @@
/* tslint:disable:no-unused-variable */
import { Component, OnInit, OnDestroy } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, TestBed } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { ButtonComponent } from './button.component';
import { ButtonModule } from './button.module';
import { IconModule, WingBlankModule, WhiteSpaceModule, ListModule } from '../..';
Expand All @@ -13,7 +13,7 @@ describe('button', () => {

describe('basic', () => {
let buttons;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestButtonComponent],
imports: [ButtonModule, IconModule, WingBlankModule, WhiteSpaceModule, ListModule]
Expand Down
4 changes: 2 additions & 2 deletions components/calendar/calendar.component.spec.ts
@@ -1,7 +1,7 @@
import { Component, ViewChild } from '@angular/core';
import { By } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { LocaleProviderService } from '../locale-provider/locale-provider.service';
import { LocaleProviderModule } from '../locale-provider/locale-provider.module';
import { ModalModule } from '../modal/modal.module';
Expand All @@ -16,7 +16,7 @@ describe('CalendarComponent', () => {
let fixture: ComponentFixture<TestCalendarBasicComponent>;
let calendarEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestCalendarBasicComponent],
providers: [LocaleProviderService],
Expand Down
4 changes: 2 additions & 2 deletions components/card/card.component.spec.ts
@@ -1,14 +1,14 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CardModule } from './card.module';

describe('CardComponent', () => {
let component;
let fixture: ComponentFixture<TestCardComponent>;
let cardEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestCardComponent],
imports: [CardModule]
Expand Down
4 changes: 2 additions & 2 deletions components/carousel/carousel.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, fakeAsync, tick, TestBed } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, tick, TestBed, waitForAsync } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CarouselModule } from './carousel.module';
import { dispatchTouchEvent } from '../core/testing';
Expand All @@ -11,7 +11,7 @@ describe('CarouselComponent', () => {
let fixture: ComponentFixture<TestCarouselComponent>;
let carouselEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestCarouselComponent],
imports: [CarouselModule, BrowserAnimationsModule]
Expand Down
@@ -1,12 +1,12 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { DotIndicatorComponent } from './dotindicator.component';

describe('DotindicatorComponent', () => {
let component: DotIndicatorComponent;
let fixture: ComponentFixture<DotIndicatorComponent>;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [DotIndicatorComponent]
}).compileComponents();
Expand Down
4 changes: 2 additions & 2 deletions components/checkbox/checkbox.component.spec.ts
@@ -1,7 +1,7 @@
import { Component, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CheckboxComponent } from './checkbox.component';
import { CheckboxModule } from './checkbox.module';

Expand All @@ -10,7 +10,7 @@ describe('checkbox', () => {
let fixture: ComponentFixture<TestCheckboxComponent>;
let checkboxEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestCheckboxComponent],
imports: [CheckboxModule, FormsModule]
Expand Down
4 changes: 2 additions & 2 deletions components/core/directive/touch-feedback.spec.ts
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { dispatchTouchEvent } from '../testing';
import { TouchFeedbackModule } from './touch-feedback.module';
import { CarouselModule, FlexModule, IconModule, GridModule } from '../../..';
Expand All @@ -9,7 +9,7 @@ describe('TouchFeedbackDirective', () => {
let fixture: ComponentFixture<TouchFeedbackDirectiveComponent>;
let gridEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TouchFeedbackDirectiveComponent],
imports: [TouchFeedbackModule, GridModule, FlexModule]
Expand Down
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DatePickerViewModule } from './date-picker-view.module';
import { DatePickerOptions, DatePickerModule } from '../date-picker/index';
import { LocaleProviderService, LocaleProviderModule, ToastModule, Toast, ToastComponent } from '../..';
Expand All @@ -14,7 +14,7 @@ describe('DatePickerViewComponent', () => {

let service: LocaleProviderService;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
// service = new LocaleProviderService(LOCAL_PROVIDER_TOKEN);
// service.setLocale(zh_CN);
TestBed.configureTestingModule({
Expand Down
4 changes: 2 additions & 2 deletions components/date-picker/date-picker.component.spec.ts
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { en_US, zh_CN } from '../locale-provider/locale';
import { DatePickerOptions, DatePickerModule, DatePickerComponent } from './index';
import {
Expand All @@ -21,7 +21,7 @@ describe('DatePickerComponent', () => {
let datePickerEle;
let lists;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestDatePickerBasicComponent],
providers: [DatePickerOptions, LocaleProviderService, Toast],
Expand Down
4 changes: 2 additions & 2 deletions components/drawer/drawer.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DrawerModule } from './drawer.module';
import { ListModule } from '../list/list.module';
import { DrawerComponent } from './drawer.component';
Expand All @@ -10,7 +10,7 @@ describe('drawer', () => {
let component;
let fixture: ComponentFixture<TestDrawerComponent>;
let drawerEle;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestDrawerComponent],
imports: [DrawerModule, ListModule]
Expand Down
4 changes: 2 additions & 2 deletions components/flex/flex.component.spec.ts
@@ -1,14 +1,14 @@
import { Component, OnDestroy } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, TestBed } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { FlexModule } from './flex.module';

describe('Flex', () => {
let component;
let fixture;
let activityEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestFlexComponent],
imports: [FlexModule]
Expand Down
4 changes: 2 additions & 2 deletions components/grid/grid.component.spec.ts
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CarouselModule, FlexModule, IconModule, GridModule } from '../..';
import { NgZorroAntdMobilePipesModule } from '../pipes/ng-zorro-antd-mobile.pipes.module';
Expand All @@ -9,7 +9,7 @@ describe('GridComponent', () => {
let fixture: ComponentFixture<TestGridComponent>;
let gridEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestGridComponent],
imports: [
Expand Down
4 changes: 2 additions & 2 deletions components/icon/icon.component.spec.ts
@@ -1,14 +1,14 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IconModule } from './icon.module';

describe('IconComponent', () => {
let component: TestIconComponent;
let fixture: ComponentFixture<TestIconComponent>;
let iconEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestIconComponent],
imports: [IconModule]
Expand Down
4 changes: 2 additions & 2 deletions components/image-picker/image-picker.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ImagePickerModule } from './image-picker.module';
import { ImagePickerComponent } from './image-picker.component';

Expand All @@ -18,7 +18,7 @@ describe('ImagePicker', () => {
let fixture: ComponentFixture<TestImagePickerComponent>;
let ImagePickers;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [ImagePickerModule],
declarations: [TestImagePickerComponent]
Expand Down
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { CustomInputComponent } from './custom-input.component';
import { InputItemModule } from '../input-item.module';
import { CustomInputService } from './custom-input.service';
Expand All @@ -9,7 +9,7 @@ describe('custom-input', () => {
let fixture: ComponentFixture<CustomInputComponent>;
let keyboard;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [InputItemModule, LocaleProviderModule],
providers: [CustomInputService]
Expand Down
4 changes: 2 additions & 2 deletions components/input-item/input-item.component.spec.ts
@@ -1,6 +1,6 @@
import { Component, ViewChild, TemplateRef } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { InputItemModule } from './input-item.module';
import { createFakeEvent, dispatchFakeEvent } from '../core/testing';
import { InputItemComponent } from './input-item.component';
Expand All @@ -13,7 +13,7 @@ describe('InputComponent', () => {
let inputEle;
let inputModel;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestInputComponent],
imports: [InputItemModule, FormsModule]
Expand Down
4 changes: 2 additions & 2 deletions components/list/list.component.spec.ts
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { ListModule } from './list.module';
import { dispatchTouchEvent } from '../core/testing';
Expand All @@ -11,7 +11,7 @@ describe('list', () => {
let listEle;
let listItemEle;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [TestListComponent],
imports: [ListModule, FormsModule]
Expand Down
2 changes: 1 addition & 1 deletion components/locale-provider/locale-provider.service.ts
Expand Up @@ -5,7 +5,7 @@ import zh_CN from './locale/zh_CN';

@Injectable()
export class LocaleProviderService {
private _locale: any;
private _locale: any = undefined;
private _change = new BehaviorSubject<any>(this._locale);

constructor(@Inject(LOCAL_PROVIDER_TOKEN) locale: any) {
Expand Down

0 comments on commit 7917100

Please sign in to comment.