From 44eb788129b307218335c9df30aad98100cc3217 Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Wed, 18 Sep 2024 07:33:16 +0200 Subject: [PATCH] chore: fix deprecated Co-Authored-by: Bertrand Zuchuat --- .../menu/menu-widget/menu-widget.component.spec.ts | 4 ++-- .../src/lib/record/detail/detail.component.spec.ts | 5 ++--- .../src/lib/record/editor/editor.component.spec.ts | 5 ++--- .../add-field-editor.component.spec.ts | 12 ++++++------ .../editor/widgets/label/label.component.spec.ts | 4 ++-- .../src/lib/widget/menu/menu.component.spec.ts | 4 ++-- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/projects/rero/ng-core/src/lib/menu/menu-widget/menu-widget.component.spec.ts b/projects/rero/ng-core/src/lib/menu/menu-widget/menu-widget.component.spec.ts index e5e4cab3..97593557 100644 --- a/projects/rero/ng-core/src/lib/menu/menu-widget/menu-widget.component.spec.ts +++ b/projects/rero/ng-core/src/lib/menu/menu-widget/menu-widget.component.spec.ts @@ -17,8 +17,8 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { MenuWidgetComponent } from './menu-widget.component'; -import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { RouterModule } from '@angular/router'; describe('MenuWidgetComponent', () => { let component: MenuWidgetComponent; @@ -27,7 +27,7 @@ describe('MenuWidgetComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - RouterTestingModule, + RouterModule.forRoot([]), TranslateModule.forRoot() ], declarations: [ diff --git a/projects/rero/ng-core/src/lib/record/detail/detail.component.spec.ts b/projects/rero/ng-core/src/lib/record/detail/detail.component.spec.ts index d6d740e7..e7fb4446 100644 --- a/projects/rero/ng-core/src/lib/record/detail/detail.component.spec.ts +++ b/projects/rero/ng-core/src/lib/record/detail/detail.component.spec.ts @@ -16,8 +16,7 @@ */ import { Location } from '@angular/common'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ActivatedRoute, ParamMap, convertToParamMap } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { ActivatedRoute, ParamMap, RouterModule, convertToParamMap } from '@angular/router'; import { TranslateFakeLoader, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, of, throwError } from 'rxjs'; import { ActionStatus } from '../action-status'; @@ -84,7 +83,7 @@ describe('RecordDetailComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, useClass: TranslateFakeLoader } }), - RouterTestingModule, + RouterModule.forRoot([]), RecordModule ], providers: [ diff --git a/projects/rero/ng-core/src/lib/record/editor/editor.component.spec.ts b/projects/rero/ng-core/src/lib/record/editor/editor.component.spec.ts index 8b676a75..87b6541a 100644 --- a/projects/rero/ng-core/src/lib/record/editor/editor.component.spec.ts +++ b/projects/rero/ng-core/src/lib/record/editor/editor.component.spec.ts @@ -16,8 +16,7 @@ */ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { ActivatedRoute, RouterModule } from '@angular/router'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { of } from 'rxjs'; import { RecordUiService } from '../record-ui.service'; @@ -79,7 +78,7 @@ describe('EditorComponent', () => { imports: [ RecordModule, BrowserAnimationsModule, - RouterTestingModule, + RouterModule.forRoot([]), TranslateModule.forRoot() ], providers: [ diff --git a/projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.spec.ts b/projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.spec.ts index d3fc24e6..968b8c5a 100644 --- a/projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.spec.ts +++ b/projects/rero/ng-core/src/lib/record/editor/widgets/add-field-editor/add-field-editor.component.spec.ts @@ -14,15 +14,15 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; -import { TypeaheadModule } from 'ngx-bootstrap/typeahead'; -import { AddFieldEditorComponent } from './add-field-editor.component'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { EditorComponent, RecordModule } from '@rero/ng-core'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { TypeaheadModule } from 'ngx-bootstrap/typeahead'; +import { AddFieldEditorComponent } from './add-field-editor.component'; describe('AddFieldEditorComponent', () => { let component: AddFieldEditorComponent; @@ -34,7 +34,7 @@ describe('AddFieldEditorComponent', () => { imports: [ BrowserAnimationsModule, HttpClientTestingModule, - RouterTestingModule, + RouterModule.forRoot([]), RecordModule, FormsModule, TypeaheadModule.forRoot(), diff --git a/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.spec.ts b/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.spec.ts index a1d75862..1c767b27 100644 --- a/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.spec.ts +++ b/projects/rero/ng-core/src/lib/record/editor/widgets/label/label.component.spec.ts @@ -18,7 +18,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; +import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { RecordModule } from '../../../record.module'; import { EditorComponent } from '../../editor.component'; @@ -36,7 +36,7 @@ describe('LabelComponent', () => { imports: [ BrowserAnimationsModule, HttpClientTestingModule, - RouterTestingModule, + RouterModule.forRoot([]), RecordModule, TranslateModule.forRoot() ] diff --git a/projects/rero/ng-core/src/lib/widget/menu/menu.component.spec.ts b/projects/rero/ng-core/src/lib/widget/menu/menu.component.spec.ts index 3dc57edf..bf07a99e 100644 --- a/projects/rero/ng-core/src/lib/widget/menu/menu.component.spec.ts +++ b/projects/rero/ng-core/src/lib/widget/menu/menu.component.spec.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; +import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { CallbackArrayFilterPipe } from '../../pipe/callback-array-filter.pipe'; import { MenuComponent } from './menu.component'; @@ -27,7 +27,7 @@ describe('MenuComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - RouterTestingModule, + RouterModule.forRoot([]), TranslateModule.forRoot() ], declarations: [ MenuComponent, CallbackArrayFilterPipe ]