From 7917100cfc2d5c81ca18ddc47cbccd748e06de95 Mon Sep 17 00:00:00 2001 From: nuonuoge <932273325@qq.com> Date: Thu, 31 Dec 2020 14:32:54 +0800 Subject: [PATCH] feat(module: all): support Angular 11 (#773) --- angular.json | 1 - .../accordion-group.component.spec.ts | 4 +- .../accordion/accordion.component.spec.ts | 4 +- .../action-sheet.component.spec.ts | 4 +- .../activity-indicator.component.spec.ts | 4 +- components/badge/badge.component.spec.ts | 4 +- components/button/button.component.spec.ts | 4 +- .../calendar/calendar.component.spec.ts | 4 +- components/card/card.component.spec.ts | 4 +- .../carousel/carousel.component.spec.ts | 4 +- .../dotindicator.component.spec.ts | 4 +- .../checkbox/checkbox.component.spec.ts | 4 +- .../core/directive/touch-feedback.spec.ts | 4 +- .../date-picker-view.component.spec.ts | 4 +- .../date-picker/date-picker.component.spec.ts | 4 +- components/drawer/drawer.component.spec.ts | 4 +- components/flex/flex.component.spec.ts | 4 +- components/grid/grid.component.spec.ts | 4 +- components/icon/icon.component.spec.ts | 4 +- .../image-picker.component.spec.ts | 4 +- .../custom-input.component.spec.ts | 4 +- .../input-item/input-item.component.spec.ts | 4 +- components/list/list.component.spec.ts | 4 +- .../locale-provider.service.ts | 2 +- components/menu/menu.component.spec.ts | 4 +- components/modal/modal.component.spec.ts | 4 +- components/nav-bar/nav-bar.component.spec.ts | 4 +- .../notice-bar/notice-bar.component.spec.ts | 32 ++++++----- components/package.json | 36 ++++++------- .../pagination/pagination.component.spec.ts | 4 +- .../picker-view/picker-view.component.spec.ts | 4 +- components/picker/picker.component.spec.ts | 4 +- .../popover-item.component.spec.ts | 4 +- components/popover/popover.component.spec.ts | 4 +- .../progress/progress.component.spec.ts | 4 +- .../pull-to-refresh.component.spec.ts | 4 +- components/radio/radio.component.spec.ts | 4 +- components/range/range.component.spec.ts | 6 +-- components/result/result.component.spec.ts | 4 +- .../search-bar/search-bar.component.spec.ts | 4 +- .../segmented-control.component.spec.ts | 4 +- components/slider/slider.component.spec.ts | 4 +- components/stepper/stepper.component.spec.ts | 4 +- components/steps/steps.component.spec.ts | 4 +- .../swipe-action.component.spec.ts | 4 +- components/switch/switch.component.spec.ts | 4 +- components/tab-bar/tab-bar.component.spec.ts | 4 +- components/tabs/tabs.component.spec.ts | 4 +- components/tag/tag.component.spec.ts | 4 +- .../textarea-item.component.spec.ts | 4 +- components/toast/toast.component.spec.ts | 4 +- .../white-space/white-space.component.spec.ts | 4 +- .../wing-blank/wing-blank.component.spec.ts | 4 +- docs/introduce.en-US.md | 2 +- docs/introduce.zh-CN.md | 2 +- package.json | 54 +++++++++---------- 56 files changed, 165 insertions(+), 162 deletions(-) diff --git a/angular.json b/angular.json index 122e1c1a..3512480b 100644 --- a/angular.json +++ b/angular.json @@ -50,7 +50,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "extractLicenses": false, "vendorChunk": false, diff --git a/components/accordion/accordion-group/accordion-group.component.spec.ts b/components/accordion/accordion-group/accordion-group.component.spec.ts index 7407d378..96599c7a 100644 --- a/components/accordion/accordion-group/accordion-group.component.spec.ts +++ b/components/accordion/accordion-group/accordion-group.component.spec.ts @@ -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'; @@ -8,7 +8,7 @@ describe('AccordionGroupComponent', () => { let component: AccordionGroupComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [AccordionGroupComponent], imports: [BrowserAnimationsModule, NgZorroAntdMobilePipesModule], diff --git a/components/accordion/accordion.component.spec.ts b/components/accordion/accordion.component.spec.ts index a44f7359..af428458 100644 --- a/components/accordion/accordion.component.spec.ts +++ b/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'; @@ -12,7 +12,7 @@ describe('AccordionComponent', () => { let fixture: ComponentFixture; let accordionEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestAccordionComponent], imports: [BrowserAnimationsModule, AccordionModule, WhiteSpaceModule], diff --git a/components/action-sheet/action-sheet.component.spec.ts b/components/action-sheet/action-sheet.component.spec.ts index 57208c85..63de50d3 100644 --- a/components/action-sheet/action-sheet.component.spec.ts +++ b/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'; @@ -12,7 +12,7 @@ describe('ActionSheetComponent', () => { let buttons; let actionSheetEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestActionSheetBasicComponent], imports: [NgZorroAntdMobilePipesModule, ActionSheetModule, ButtonModule], diff --git a/components/activity-indicator/activity-indicator.component.spec.ts b/components/activity-indicator/activity-indicator.component.spec.ts index d6b693a8..ec124ca1 100644 --- a/components/activity-indicator/activity-indicator.component.spec.ts +++ b/components/activity-indicator/activity-indicator.component.spec.ts @@ -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] diff --git a/components/badge/badge.component.spec.ts b/components/badge/badge.component.spec.ts index e68cc254..ccf18a4b 100644 --- a/components/badge/badge.component.spec.ts +++ b/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; let badgeEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestBadgeComponent], imports: [BadgeModule] diff --git a/components/button/button.component.spec.ts b/components/button/button.component.spec.ts index d9507c1e..e86cb820 100644 --- a/components/button/button.component.spec.ts +++ b/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 '../..'; @@ -13,7 +13,7 @@ describe('button', () => { describe('basic', () => { let buttons; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestButtonComponent], imports: [ButtonModule, IconModule, WingBlankModule, WhiteSpaceModule, ListModule] diff --git a/components/calendar/calendar.component.spec.ts b/components/calendar/calendar.component.spec.ts index 371a99fa..fc7988c1 100644 --- a/components/calendar/calendar.component.spec.ts +++ b/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'; @@ -16,7 +16,7 @@ describe('CalendarComponent', () => { let fixture: ComponentFixture; let calendarEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestCalendarBasicComponent], providers: [LocaleProviderService], diff --git a/components/card/card.component.spec.ts b/components/card/card.component.spec.ts index 6e21ea61..27c9334f 100644 --- a/components/card/card.component.spec.ts +++ b/components/card/card.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 { CardModule } from './card.module'; describe('CardComponent', () => { @@ -8,7 +8,7 @@ describe('CardComponent', () => { let fixture: ComponentFixture; let cardEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestCardComponent], imports: [CardModule] diff --git a/components/carousel/carousel.component.spec.ts b/components/carousel/carousel.component.spec.ts index 180b1c25..8af7dee1 100644 --- a/components/carousel/carousel.component.spec.ts +++ b/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'; @@ -11,7 +11,7 @@ describe('CarouselComponent', () => { let fixture: ComponentFixture; let carouselEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestCarouselComponent], imports: [CarouselModule, BrowserAnimationsModule] diff --git a/components/carousel/dotindicator/dotindicator.component.spec.ts b/components/carousel/dotindicator/dotindicator.component.spec.ts index e22c4e52..e6d08caa 100644 --- a/components/carousel/dotindicator/dotindicator.component.spec.ts +++ b/components/carousel/dotindicator/dotindicator.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { DotIndicatorComponent } from './dotindicator.component'; @@ -6,7 +6,7 @@ describe('DotindicatorComponent', () => { let component: DotIndicatorComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [DotIndicatorComponent] }).compileComponents(); diff --git a/components/checkbox/checkbox.component.spec.ts b/components/checkbox/checkbox.component.spec.ts index 8ef17ff0..a9b85d09 100644 --- a/components/checkbox/checkbox.component.spec.ts +++ b/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'; @@ -10,7 +10,7 @@ describe('checkbox', () => { let fixture: ComponentFixture; let checkboxEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestCheckboxComponent], imports: [CheckboxModule, FormsModule] diff --git a/components/core/directive/touch-feedback.spec.ts b/components/core/directive/touch-feedback.spec.ts index f0f6ae39..04a87b17 100644 --- a/components/core/directive/touch-feedback.spec.ts +++ b/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 '../../..'; @@ -9,7 +9,7 @@ describe('TouchFeedbackDirective', () => { let fixture: ComponentFixture; let gridEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TouchFeedbackDirectiveComponent], imports: [TouchFeedbackModule, GridModule, FlexModule] diff --git a/components/date-picker-view/date-picker-view.component.spec.ts b/components/date-picker-view/date-picker-view.component.spec.ts index a65542f8..52c38132 100644 --- a/components/date-picker-view/date-picker-view.component.spec.ts +++ b/components/date-picker-view/date-picker-view.component.spec.ts @@ -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 '../..'; @@ -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({ diff --git a/components/date-picker/date-picker.component.spec.ts b/components/date-picker/date-picker.component.spec.ts index 52037514..436d783d 100644 --- a/components/date-picker/date-picker.component.spec.ts +++ b/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 { @@ -21,7 +21,7 @@ describe('DatePickerComponent', () => { let datePickerEle; let lists; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestDatePickerBasicComponent], providers: [DatePickerOptions, LocaleProviderService, Toast], diff --git a/components/drawer/drawer.component.spec.ts b/components/drawer/drawer.component.spec.ts index d5f3f65c..7331e379 100644 --- a/components/drawer/drawer.component.spec.ts +++ b/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'; @@ -10,7 +10,7 @@ describe('drawer', () => { let component; let fixture: ComponentFixture; let drawerEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestDrawerComponent], imports: [DrawerModule, ListModule] diff --git a/components/flex/flex.component.spec.ts b/components/flex/flex.component.spec.ts index 3d3d6101..40100aaa 100644 --- a/components/flex/flex.component.spec.ts +++ b/components/flex/flex.component.spec.ts @@ -1,6 +1,6 @@ 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', () => { @@ -8,7 +8,7 @@ describe('Flex', () => { let fixture; let activityEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestFlexComponent], imports: [FlexModule] diff --git a/components/grid/grid.component.spec.ts b/components/grid/grid.component.spec.ts index 9cc620bd..975421c9 100644 --- a/components/grid/grid.component.spec.ts +++ b/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'; @@ -9,7 +9,7 @@ describe('GridComponent', () => { let fixture: ComponentFixture; let gridEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestGridComponent], imports: [ diff --git a/components/icon/icon.component.spec.ts b/components/icon/icon.component.spec.ts index e41f5bbf..8950e58e 100644 --- a/components/icon/icon.component.spec.ts +++ b/components/icon/icon.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 { IconModule } from './icon.module'; describe('IconComponent', () => { @@ -8,7 +8,7 @@ describe('IconComponent', () => { let fixture: ComponentFixture; let iconEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestIconComponent], imports: [IconModule] diff --git a/components/image-picker/image-picker.component.spec.ts b/components/image-picker/image-picker.component.spec.ts index 8e996651..7a3e51fa 100644 --- a/components/image-picker/image-picker.component.spec.ts +++ b/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'; @@ -18,7 +18,7 @@ describe('ImagePicker', () => { let fixture: ComponentFixture; let ImagePickers; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ImagePickerModule], declarations: [TestImagePickerComponent] diff --git a/components/input-item/custom-input/custom-input.component.spec.ts b/components/input-item/custom-input/custom-input.component.spec.ts index d45abaaf..6b8f42e2 100644 --- a/components/input-item/custom-input/custom-input.component.spec.ts +++ b/components/input-item/custom-input/custom-input.component.spec.ts @@ -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'; @@ -9,7 +9,7 @@ describe('custom-input', () => { let fixture: ComponentFixture; let keyboard; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [InputItemModule, LocaleProviderModule], providers: [CustomInputService] diff --git a/components/input-item/input-item.component.spec.ts b/components/input-item/input-item.component.spec.ts index 5eb3aacc..dceae8c1 100644 --- a/components/input-item/input-item.component.spec.ts +++ b/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'; @@ -13,7 +13,7 @@ describe('InputComponent', () => { let inputEle; let inputModel; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestInputComponent], imports: [InputItemModule, FormsModule] diff --git a/components/list/list.component.spec.ts b/components/list/list.component.spec.ts index b936080d..45b07f59 100644 --- a/components/list/list.component.spec.ts +++ b/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'; @@ -11,7 +11,7 @@ describe('list', () => { let listEle; let listItemEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestListComponent], imports: [ListModule, FormsModule] diff --git a/components/locale-provider/locale-provider.service.ts b/components/locale-provider/locale-provider.service.ts index ada59b3d..02d3e525 100644 --- a/components/locale-provider/locale-provider.service.ts +++ b/components/locale-provider/locale-provider.service.ts @@ -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(this._locale); constructor(@Inject(LOCAL_PROVIDER_TOKEN) locale: any) { diff --git a/components/menu/menu.component.spec.ts b/components/menu/menu.component.spec.ts index 86a63620..f6dbf5b7 100644 --- a/components/menu/menu.component.spec.ts +++ b/components/menu/menu.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 { MenuModule } from './menu.module'; import { MenuComponent } from './menu.component'; import { LocaleProviderModule } from '../locale-provider/locale-provider.module'; @@ -11,7 +11,7 @@ describe('MenuComponent', () => { let fixture: ComponentFixture; let menuEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestMenuComponent], imports: [MenuModule, LocaleProviderModule] diff --git a/components/modal/modal.component.spec.ts b/components/modal/modal.component.spec.ts index c8dfdc29..32d81d44 100644 --- a/components/modal/modal.component.spec.ts +++ b/components/modal/modal.component.spec.ts @@ -1,6 +1,6 @@ import { Component, ViewChild, ViewContainerRef } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { async, ComponentFixture, fakeAsync, tick, TestBed, flush } from '@angular/core/testing'; +import { ComponentFixture, fakeAsync, tick, TestBed, flush, waitForAsync } from '@angular/core/testing'; import { ModalModule, WingBlankModule, ListModule, WhiteSpaceModule, ButtonModule, ModalRef } from '../..'; import { By } from '@angular/platform-browser'; import { ModalService, ModalServiceComponent, ModalComponent } from '../..'; @@ -14,7 +14,7 @@ describe('ModalComponent', () => { let modalEle; let buttons; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestModalBasicComponent], imports: [ diff --git a/components/nav-bar/nav-bar.component.spec.ts b/components/nav-bar/nav-bar.component.spec.ts index 24431dc4..ad65d9c1 100644 --- a/components/nav-bar/nav-bar.component.spec.ts +++ b/components/nav-bar/nav-bar.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 { NavBarModule, IconModule } from '../..'; describe('NavBarComponent', () => { @@ -8,7 +8,7 @@ describe('NavBarComponent', () => { let fixture: ComponentFixture; let navBarEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestNavBarBasicComponent], imports: [NavBarModule, IconModule] diff --git a/components/notice-bar/notice-bar.component.spec.ts b/components/notice-bar/notice-bar.component.spec.ts index d441a3f5..05b3ec18 100644 --- a/components/notice-bar/notice-bar.component.spec.ts +++ b/components/notice-bar/notice-bar.component.spec.ts @@ -1,6 +1,6 @@ -import { Component, ContentChild, TemplateRef } from '@angular/core'; +import { Component, ContentChild, OnInit, TemplateRef } 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/icon.module'; import { NoticeBarModule } from './notice-bar.module'; @@ -9,7 +9,7 @@ describe('NoticeBarComponent', () => { let fixture: ComponentFixture; let noticeBarEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestNoticeBarComponent], imports: [IconModule, NoticeBarModule] @@ -67,21 +67,25 @@ describe('NoticeBarComponent', () => { ` }) -export class TestNoticeBarComponent { +export class TestNoticeBarComponent implements OnInit { @ContentChild('iconDom') icon: TemplateRef; @ContentChild('action') action: TemplateRef; - option = { - content: - '我是小黄条,小黄条的小,小黄条的黄,小黄条的条,请多多关照!!!我是小黄条,小黄条的小,小黄条的黄,小黄条的条,请多多关照!!!', - fontSize: '24px', - icon: this.icon, - action: this.action, - mode: 'closable', - scrolling: true, - marqueeProps: { loop: true, leading: 500, trailing: 8000, fps: 200, style: {} } - }; + option: any; + + ngOnInit() { + this.option = { + content: + '我是小黄条,小黄条的小,小黄条的黄,小黄条的条,请多多关照!!!我是小黄条,小黄条的小,小黄条的黄,小黄条的条,请多多关照!!!', + fontSize: '24px', + icon: this.icon, + action: this.action, + mode: 'closable', + scrolling: true, + marqueeProps: { loop: true, leading: 500, trailing: 8000, fps: 200, style: {} } + }; + } onClick() { console.log('1'); diff --git a/components/package.json b/components/package.json index aafd885a..5742d469 100644 --- a/components/package.json +++ b/components/package.json @@ -22,27 +22,27 @@ "url": "https://github.com/NG-ZORRO/ng-zorro-antd-mobile/issues" }, "dependencies": { - "@angular/cdk": "^10.1.3", - "@angular/animations": "^10.0.14", - "@ant-design/icons-angular": "^10.0.0" + "@angular/cdk": "^11.0.3", + "@angular/animations": "^11.0.5", + "@ant-design/icons-angular": "^11.0.1" }, "devDependencies": { - "@angular/common": "^10.0.14", - "@angular/compiler": "^10.0.14", - "@angular/core": "^10.0.14", - "@angular/forms": "^10.0.14", - "@angular/http": "^7.2.13", - "@angular/platform-browser": "^10.0.14", - "@angular/platform-browser-dynamic": "^10.0.14", - "@angular/router": "^10.0.14", - "@angular/upgrade": "^10.0.14", - "@angular-devkit/build-angular": "^0.1000.8", - "@angular/cli": "^10.0.8", - "@angular/compiler-cli": "^10.0.14", - "@angular/platform-server": "^10.0.14", - "tslint": "~5.18.0", + "@angular/common": "^11.0.5", + "@angular/compiler": "^11.0.5", + "@angular/core": "^11.0.5", + "@angular/forms": "^11.0.5", + "@angular/http": "^7.2.16", + "@angular/platform-browser": "^11.0.5", + "@angular/platform-browser-dynamic": "^11.0.5", + "@angular/router": "^11.0.5", + "@angular/upgrade": "^11.0.5", + "@angular-devkit/build-angular": "^0.1100.5", + "@angular/cli": "^11.0.5", + "@angular/compiler-cli": "^11.0.5", + "@angular/platform-server": "^11.0.5", "tslib": "^2.0.1", - "typescript": "~3.9.7" + "tslint": "~6.1.3", + "typescript": "~4.0.5" }, "lint-staged": { "{src,docs}/**/*.{scss}": [ diff --git a/components/pagination/pagination.component.spec.ts b/components/pagination/pagination.component.spec.ts index 253b73f3..e3dd6f2c 100644 --- a/components/pagination/pagination.component.spec.ts +++ b/components/pagination/pagination.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 { PaginationModule } from './pagination.module'; import { IconModule } from '../icon/icon.module'; import { LocaleProviderModule } from '../locale-provider/locale-provider.module'; @@ -13,7 +13,7 @@ describe('pagination', () => { let prevButton; let nextButton; let wrapper; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestPaginationComponent], imports: [PaginationModule, IconModule, LocaleProviderModule] diff --git a/components/picker-view/picker-view.component.spec.ts b/components/picker-view/picker-view.component.spec.ts index 4177a800..ad8e8154 100644 --- a/components/picker-view/picker-view.component.spec.ts +++ b/components/picker-view/picker-view.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 { PickerViewModule } from './picker-view.module'; import { PickerOptions } from '../picker/picker-options.provider'; import { LocaleProviderService, LocaleProviderModule } from '../..'; @@ -12,7 +12,7 @@ describe('PickerViewComponent', () => { let pickerEle; let pickerEleForNgModel; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestPickerViewBasicComponent], imports: [PickerViewModule, LocaleProviderModule, FormsModule], diff --git a/components/picker/picker.component.spec.ts b/components/picker/picker.component.spec.ts index 307e3941..d30df70a 100644 --- a/components/picker/picker.component.spec.ts +++ b/components/picker/picker.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, fakeAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, waitForAsync } from '@angular/core/testing'; import { ListModule, PickerModule, PickerComponent, PickerDirective } from '../..'; import { PickerOptions } from './picker-options.provider'; import { PickerService } from './picker.service'; @@ -18,7 +18,7 @@ describe('PickerComponent', () => { let buttons; let pickerEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestPickerBasicComponent], providers: [PickerOptions, LocaleProviderService, Overlay], diff --git a/components/popover/popover-item/popover-item.component.spec.ts b/components/popover/popover-item/popover-item.component.spec.ts index 708d1300..81466c61 100644 --- a/components/popover/popover-item/popover-item.component.spec.ts +++ b/components/popover/popover-item/popover-item.component.spec.ts @@ -1,4 +1,4 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { PopoverItemComponent } from './popover-item.component'; @@ -6,7 +6,7 @@ describe('PopoverItemComponent', () => { let component: PopoverItemComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [PopoverItemComponent] }).compileComponents(); diff --git a/components/popover/popover.component.spec.ts b/components/popover/popover.component.spec.ts index d8a83879..2adae56d 100644 --- a/components/popover/popover.component.spec.ts +++ b/components/popover/popover.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 { PopoverComponentOptions } from './popover-component-options.provider'; import { PopoverModule, IconModule, PopoverItemModule } from '../..'; import { dispatchTouchEvent } from '../core/testing'; @@ -12,7 +12,7 @@ describe('PopoverComponent', () => { let button; let popoverEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestPopoverComponent], providers: [PopoverComponentOptions, PopoverOptions], diff --git a/components/progress/progress.component.spec.ts b/components/progress/progress.component.spec.ts index d1c68906..929d5c0d 100644 --- a/components/progress/progress.component.spec.ts +++ b/components/progress/progress.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 { ProgressModule } from './progress.module'; describe('ProgressComponent', () => { @@ -8,7 +8,7 @@ describe('ProgressComponent', () => { let fixture: ComponentFixture; let progressEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestProgressComponent], imports: [ProgressModule] diff --git a/components/pull-to-refresh/pull-to-refresh.component.spec.ts b/components/pull-to-refresh/pull-to-refresh.component.spec.ts index 0ba8693d..461bff2e 100644 --- a/components/pull-to-refresh/pull-to-refresh.component.spec.ts +++ b/components/pull-to-refresh/pull-to-refresh.component.spec.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { By } from '@angular/platform-browser'; -import { async, ComponentFixture, TestBed, tick } from '@angular/core/testing'; +import { ComponentFixture, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { PullToRefreshModule } from './pull-to-refresh.module'; import { IconModule } from '../icon/icon.module'; @@ -12,7 +12,7 @@ describe('PullToRefreshComponent', () => { let fixture: ComponentFixture; let pullToRefreshEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestPullToRefreshComponent], imports: [PullToRefreshModule, IconModule, FormsModule, ReactiveFormsModule] diff --git a/components/radio/radio.component.spec.ts b/components/radio/radio.component.spec.ts index 0cecb7da..c80e4323 100644 --- a/components/radio/radio.component.spec.ts +++ b/components/radio/radio.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 { RadioComponent } from './radio.component'; import { RadioModule } from './radio.module'; @@ -10,7 +10,7 @@ describe('radio', () => { let fixture: ComponentFixture; let radioEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestRadioComponent], imports: [RadioModule, FormsModule] diff --git a/components/range/range.component.spec.ts b/components/range/range.component.spec.ts index f232f6be..e3fa8a2a 100644 --- a/components/range/range.component.spec.ts +++ b/components/range/range.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, fakeAsync, tick } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; import { RangeModule } from './range.module'; import { dispatchMouseEvent } from '../core/testing'; @@ -12,7 +12,7 @@ describe('RangeComponent', () => { let amSlider; let sliderHandler; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestRangeComponent], imports: [RangeModule, FormsModule] @@ -121,7 +121,7 @@ describe('RangeModelComponent', () => { let amSlider; let sliderHandler; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestRangeModelComponent], imports: [RangeModule, FormsModule] diff --git a/components/result/result.component.spec.ts b/components/result/result.component.spec.ts index 44959254..e562d2b7 100644 --- a/components/result/result.component.spec.ts +++ b/components/result/result.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 { ResultModule } from './result.module'; import { ButtonModule } from '../button/button.module'; @@ -10,7 +10,7 @@ describe('Result', () => { let fixture: ComponentFixture; let results; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ResultModule, ButtonModule], declarations: [TestResultComponent] diff --git a/components/search-bar/search-bar.component.spec.ts b/components/search-bar/search-bar.component.spec.ts index cb5fa600..af9d4aa7 100644 --- a/components/search-bar/search-bar.component.spec.ts +++ b/components/search-bar/search-bar.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, fakeAsync, tick } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; import { SearchBarModule } from './search-bar.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { LocaleProviderModule } from '../locale-provider/locale-provider.module'; @@ -15,7 +15,7 @@ describe('SearchBarComponent', () => { let formEle; let buttonEle; let cancelEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestSearchBarComponent], imports: [SearchBarModule, BrowserAnimationsModule, LocaleProviderModule, FormsModule] diff --git a/components/segmented-control/segmented-control.component.spec.ts b/components/segmented-control/segmented-control.component.spec.ts index 7e95a0d0..c98d168c 100644 --- a/components/segmented-control/segmented-control.component.spec.ts +++ b/components/segmented-control/segmented-control.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 { SegmentedControlModule } from './segmented-control.module'; describe('segmented-control', () => { @@ -8,7 +8,7 @@ describe('segmented-control', () => { let fixture: ComponentFixture; let segmentedControlEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestSegmentedControlComponent], imports: [SegmentedControlModule] diff --git a/components/slider/slider.component.spec.ts b/components/slider/slider.component.spec.ts index b7722740..510e6221 100755 --- a/components/slider/slider.component.spec.ts +++ b/components/slider/slider.component.spec.ts @@ -1,7 +1,7 @@ import { OnInit, 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 { SliderModule } from './slider.module'; import { dispatchMouseEvent, dispatchTouchEvent } from '../core/testing'; @@ -15,7 +15,7 @@ describe('SliderComponent', () => { let sliderSteps; let sliderMarks; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestSliderComponent], imports: [SliderModule, FormsModule] diff --git a/components/stepper/stepper.component.spec.ts b/components/stepper/stepper.component.spec.ts index 9bbfa132..a4c5ad91 100644 --- a/components/stepper/stepper.component.spec.ts +++ b/components/stepper/stepper.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, fakeAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, waitForAsync } from '@angular/core/testing'; import { StepperModule } from './stepper.module'; describe('StepperComponent', () => { @@ -12,7 +12,7 @@ describe('StepperComponent', () => { let upButton; let downButton; let inputEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestStepperComponent], imports: [StepperModule, FormsModule] diff --git a/components/steps/steps.component.spec.ts b/components/steps/steps.component.spec.ts index b0ea1225..66bc7f9d 100644 --- a/components/steps/steps.component.spec.ts +++ b/components/steps/steps.component.spec.ts @@ -1,6 +1,6 @@ import { Component } 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 { StepsModule } from './steps.module'; import { StepStatusEnum, StepDirectionEnum } from './step/step.component'; @@ -10,7 +10,7 @@ describe('StepsComponent', () => { let stepsEle; let stepList; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestStepsComponent], imports: [StepsModule] diff --git a/components/swipe-action/swipe-action.component.spec.ts b/components/swipe-action/swipe-action.component.spec.ts index d7369e3c..6903ec71 100644 --- a/components/swipe-action/swipe-action.component.spec.ts +++ b/components/swipe-action/swipe-action.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 { SwipeActionModule } from './swipe-action.module'; import { SwipeActionComponent } from './swipe-action.component'; import { dispatchTouchEvent } from '../core/testing'; @@ -10,7 +10,7 @@ describe('swipeAction', () => { let fixture: ComponentFixture; let swipeActionEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestSwipeActionComponent], imports: [SwipeActionModule] diff --git a/components/switch/switch.component.spec.ts b/components/switch/switch.component.spec.ts index 9b95d39e..3be2f20f 100644 --- a/components/switch/switch.component.spec.ts +++ b/components/switch/switch.component.spec.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { async, ComponentFixture, TestBed, fakeAsync, flush } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, flush, waitForAsync } from '@angular/core/testing'; import { SwitchModule } from './switch.module'; import { IconModule } from '../icon/icon.module'; import { By } from '@angular/platform-browser'; @@ -11,7 +11,7 @@ describe('SwitchComponent', () => { let switchEle; let inputEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestSwitchComponent], imports: [SwitchModule, IconModule, FormsModule] diff --git a/components/tab-bar/tab-bar.component.spec.ts b/components/tab-bar/tab-bar.component.spec.ts index 8ebbdbc7..6f21c12f 100644 --- a/components/tab-bar/tab-bar.component.spec.ts +++ b/components/tab-bar/tab-bar.component.spec.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; +import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { TabBarModule } from './tab-bar.module'; import { TabsModule } from '../tabs/tabs.module'; @@ -10,7 +10,7 @@ describe('tabbar', () => { let fixture: ComponentFixture; let tabBarEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestTabBarComponent], imports: [TabBarModule, TabsModule, NoopAnimationsModule, BrowserAnimationsModule] diff --git a/components/tabs/tabs.component.spec.ts b/components/tabs/tabs.component.spec.ts index ca95a8c1..95dd8966 100644 --- a/components/tabs/tabs.component.spec.ts +++ b/components/tabs/tabs.component.spec.ts @@ -1,6 +1,6 @@ import { Component, ViewChild, ViewChildren, QueryList } 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, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { dispatchTouchEvent } from '../core/testing'; import { TabsComponent } from './tabs.component'; @@ -12,7 +12,7 @@ describe('tab', () => { let fixture: ComponentFixture; let tabsEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestTabsComponent], imports: [TabsModule, NoopAnimationsModule, BrowserAnimationsModule] diff --git a/components/tag/tag.component.spec.ts b/components/tag/tag.component.spec.ts index 6e20c223..f5066c70 100644 --- a/components/tag/tag.component.spec.ts +++ b/components/tag/tag.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 { TagModule } from './tag.module'; describe('tag', () => { @@ -9,7 +9,7 @@ describe('tag', () => { let tagEle; let closeButton; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestTagComponent], imports: [TagModule] diff --git a/components/textarea-item/textarea-item.component.spec.ts b/components/textarea-item/textarea-item.component.spec.ts index da197f2e..2db278c0 100644 --- a/components/textarea-item/textarea-item.component.spec.ts +++ b/components/textarea-item/textarea-item.component.spec.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { FormsModule } from '@angular/forms'; 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 { TextareaItemModule } from './textarea-item.module'; import { TextareaItemComponent } from './textarea-item.component'; import { dispatchFakeEvent } from '../core/testing'; @@ -15,7 +15,7 @@ describe('TextareaComponent', () => { let textareaItem; let textareaModel; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestTextareaItemComponent], imports: [TextareaItemModule, FormsModule] diff --git a/components/toast/toast.component.spec.ts b/components/toast/toast.component.spec.ts index fe2b982e..d064de00 100644 --- a/components/toast/toast.component.spec.ts +++ b/components/toast/toast.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 { ToastService } from './toast.service'; import { ToastComponent } from './toast.component'; import { ToastModule } from './toast.module'; @@ -14,7 +14,7 @@ describe('ToastComponent', () => { let toastEle1; let buttons; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [TestToastComponent], imports: [IconModule, ToastModule, ButtonModule] diff --git a/components/white-space/white-space.component.spec.ts b/components/white-space/white-space.component.spec.ts index 1b7c738a..c0946b41 100644 --- a/components/white-space/white-space.component.spec.ts +++ b/components/white-space/white-space.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 { WhiteSpaceModule } from './white-space.module'; describe('WhiteSpace', () => { @@ -8,7 +8,7 @@ describe('WhiteSpace', () => { let fixture: ComponentFixture; let WhiteSpaceEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [WhiteSpaceModule], declarations: [TestWhiteSpaceComponent] diff --git a/components/wing-blank/wing-blank.component.spec.ts b/components/wing-blank/wing-blank.component.spec.ts index 595d277f..063bf173 100644 --- a/components/wing-blank/wing-blank.component.spec.ts +++ b/components/wing-blank/wing-blank.component.spec.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { WingBlankModule } from './wing-blank.module'; @@ -8,7 +8,7 @@ describe('WingBlank', () => { let fixture: ComponentFixture; let WingBlankEle; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [WingBlankModule], declarations: [TestWingBlankComponent] diff --git a/docs/introduce.en-US.md b/docs/introduce.en-US.md index 4c835f66..751d9b55 100755 --- a/docs/introduce.en-US.md +++ b/docs/introduce.en-US.md @@ -133,7 +133,7 @@ This is the **Angular** implementation of **Ant Design Mobile** specification, s ## Angular Support -Now Supports Angular `^10.0.0`. +Now Supports Angular `^11.0.0`. ## Installation diff --git a/docs/introduce.zh-CN.md b/docs/introduce.zh-CN.md index 4a812ef3..7c63b8b1 100755 --- a/docs/introduce.zh-CN.md +++ b/docs/introduce.zh-CN.md @@ -133,7 +133,7 @@ title: Ant Design Mobile of Angular