mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
Angular 18 upgrade
This commit is contained in:
@@ -26,8 +26,7 @@ import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { PluginEnabledGuard } from './plugin-enabled.guard';
|
||||
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
describe('PluginEnabledGuard', () => {
|
||||
let getSpy: jasmine.Spy<(key: string, defaultValue?: boolean) => boolean>;
|
||||
@@ -35,8 +34,7 @@ describe('PluginEnabledGuard', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
imports: [HttpClientTestingModule]
|
||||
});
|
||||
getSpy = spyOn(TestBed.inject(AppConfigService), 'get');
|
||||
route = new ActivatedRouteSnapshot();
|
||||
|
@@ -26,15 +26,15 @@ import { AppService } from './app.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
AuthenticationService,
|
||||
NotificationService,
|
||||
PageTitleService,
|
||||
StorageService,
|
||||
TranslationMock,
|
||||
TranslationService,
|
||||
UserPreferencesService
|
||||
UserPreferencesService,
|
||||
NotificationService,
|
||||
StorageService
|
||||
} from '@alfresco/adf-core';
|
||||
import { BehaviorSubject, Observable, of, Subject } from 'rxjs';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
@@ -73,7 +73,7 @@ describe('AppService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CommonModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), MatDialogModule, MatSnackBarModule],
|
||||
imports: [CommonModule, HttpClientModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), MatDialogModule, MatSnackBarModule],
|
||||
providers: [
|
||||
SearchQueryBuilderService,
|
||||
provideMockStore({}),
|
||||
@@ -121,8 +121,7 @@ describe('AppService', () => {
|
||||
setStoragePrefix: () => null,
|
||||
getPropertyKey: (property: string) => `prefix__${property}`
|
||||
}
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -27,7 +27,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateLoaderService, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
@@ -93,10 +93,10 @@ export class DocumentBasePageServiceMock extends DocumentBasePageService {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
exports: [TranslateModule],
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CommonModule,
|
||||
HttpClientModule,
|
||||
RouterTestingModule,
|
||||
MatIconTestingModule,
|
||||
StoreModule,
|
||||
@@ -119,10 +119,10 @@ export class DocumentBasePageServiceMock extends DocumentBasePageService {
|
||||
}
|
||||
})
|
||||
],
|
||||
exports: [TranslateModule],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
]
|
||||
})
|
||||
export class LibTestingModule {}
|
||||
|
Reference in New Issue
Block a user