Skip to content

Commit

Permalink
test: add RouterTestingModule to spec files (#7605)
Browse files Browse the repository at this point in the history
  • Loading branch information
simplejason committed Aug 11, 2022
1 parent 8b92c63 commit a142eb2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/breadcrumb/breadcrumb.spec.ts
Expand Up @@ -56,7 +56,7 @@ describe('breadcrumb', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [NzBreadCrumbModule, NzDropDownModule],
imports: [RouterTestingModule, NzBreadCrumbModule, NzDropDownModule],
declarations: [NzDemoBreadcrumbDropdownComponent],
providers: []
}).compileComponents();
Expand Down
3 changes: 2 additions & 1 deletion components/dropdown/context-menu.service.spec.ts
Expand Up @@ -2,6 +2,7 @@ import { OverlayContainer, ScrollDispatcher } from '@angular/cdk/overlay';
import { ApplicationRef, Component, Provider, Type, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { Subject } from 'rxjs';

import { createMouseEvent } from 'ng-zorro-antd/core/testing';
Expand All @@ -21,7 +22,7 @@ describe('context-menu', () => {
declarations: any[] = []
): ComponentFixture<T> {
TestBed.configureTestingModule({
imports: [NzDropDownModule, NzMenuModule, NoopAnimationsModule],
imports: [RouterTestingModule, NzDropDownModule, NzMenuModule, NoopAnimationsModule],
declarations: [component, ...declarations],
providers
})
Expand Down
3 changes: 2 additions & 1 deletion components/dropdown/dropdown.directive.spec.ts
Expand Up @@ -4,6 +4,7 @@ import { Component, Provider, Type } from '@angular/core';
import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';

import { dispatchFakeEvent, dispatchKeyboardEvent } from 'ng-zorro-antd/core/testing';
import { NzMenuModule } from 'ng-zorro-antd/menu';
Expand All @@ -21,7 +22,7 @@ describe('dropdown', () => {
declarations: any[] = []
): ComponentFixture<T> {
TestBed.configureTestingModule({
imports: [NzDropDownModule, NzMenuModule, NoopAnimationsModule],
imports: [RouterTestingModule, NzDropDownModule, NzMenuModule, NoopAnimationsModule],
declarations: [component, ...declarations],
providers
})
Expand Down
3 changes: 2 additions & 1 deletion components/menu/menu.spec.ts
Expand Up @@ -4,6 +4,7 @@ import { Component, DebugElement, ElementRef, QueryList, ViewChild, ViewChildren
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';

import { dispatchFakeEvent } from 'ng-zorro-antd/core/testing';
import { NzIconTestModule } from 'ng-zorro-antd/icon/testing';
Expand All @@ -19,7 +20,7 @@ describe('menu', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [BidiModule, NzMenuModule, NoopAnimationsModule, NzIconTestModule],
imports: [RouterTestingModule, BidiModule, NzMenuModule, NoopAnimationsModule, NzIconTestModule],
declarations: [
NzTestBasicMenuHorizontalComponent,
NzTestBasicMenuInlineComponent,
Expand Down
3 changes: 2 additions & 1 deletion components/table/src/testing/th.spec.ts
Expand Up @@ -2,6 +2,7 @@ import { ApplicationRef, Component, DebugElement, ViewChild } from '@angular/cor
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';

import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzIconTestModule } from 'ng-zorro-antd/icon/testing';
Expand All @@ -12,7 +13,7 @@ import { NzTableModule } from '../table.module';
describe('nz-th', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [NzTableModule, NzIconTestModule, NoopAnimationsModule],
imports: [RouterTestingModule, NzTableModule, NzIconTestModule, NoopAnimationsModule],
declarations: [NzThTestNzTableComponent, NzThTestTableDefaultFilterComponent]
});
TestBed.compileComponents();
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/tabset.component.spec.ts
Expand Up @@ -22,7 +22,7 @@ import { NzTabSetComponent } from './tabset.component';
describe('NzTabSet', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [NzTabsModule, NzIconTestModule, CommonModule, NoopAnimationsModule],
imports: [RouterTestingModule, NzTabsModule, NzIconTestModule, CommonModule, NoopAnimationsModule],
declarations: [
SimpleTabsTestComponent,
TemplateTabsTestComponent,
Expand Down

0 comments on commit a142eb2

Please sign in to comment.