mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-04-23 22:30:37 +00:00
AAE-36484 improved standalone support for Core (#10998)
improved standalone support
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AgentService } from './agent.service';
|
||||
import { Agent, AgentPaging } from '@alfresco/js-api';
|
||||
|
||||
@@ -53,10 +52,6 @@ describe('AgentService', () => {
|
||||
let agentService: AgentService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
|
||||
agentService = TestBed.inject(AgentService);
|
||||
});
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { CoreTestingModule, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY, firstValueFrom, of } from 'rxjs';
|
||||
import { JobIdBodyEntry, SizeDetails, SizeDetailsEntry } from '@alfresco/js-api';
|
||||
import { NodesApiService } from './nodes-api.service';
|
||||
@@ -46,7 +45,6 @@ describe('NodesApiService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, CoreTestingModule],
|
||||
providers: [
|
||||
NodesApiService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
# @alfresco/adf-core/shell
|
||||
|
||||
Secondary entry point of `@alfresco/adf-core`. It can be used by importing from `@alfresco/adf-core/shell`.
|
||||
Namespace: `@alfresco/adf-core/shell`.
|
||||
|
||||
This module provides the main layout for the application, allowing you to define routes and guards for your application shell.
|
||||
|
||||
# Shell
|
||||
|
||||
[ShellModule](./src/lib/shell.module.ts) is designated as a main layout for the application.
|
||||
Passed routes are going to be attached to shell main route.
|
||||
|
||||
I order to attach routes to appShell, `withRoutes(routes: Routes | AppShellRoutesConfig)` method should be used.
|
||||
```typescript
|
||||
import { provideShellRoutes } from '@alfresco/adf-core/shell';
|
||||
|
||||
Passed routes are going to be attached to [shell main route](./src/lib/shell.routes.ts)
|
||||
provideShellRoutes([/*Your Routes*/])
|
||||
```
|
||||
|
||||
If you would like to provide custom app guard, you can provide your own using [SHELL_AUTH_TOKEN](./src/lib/shell.routes.ts)
|
||||
If you would like to provide custom app guard, you can provide your own using `SHELL_AUTH_TOKEN`.
|
||||
|
||||
## Shell Service
|
||||
|
||||
In order to use `shell`, you need to provide [SHELL_APP_SERVICE](./src/lib/services/shell-app.service.ts) which provides necessary options for shell component to work.
|
||||
In order to use `shell`, you need to provide `SHELL_APP_SERVICE` which provides necessary options for shell component to work.
|
||||
|
||||
@@ -18,3 +18,4 @@
|
||||
export * from './lib/shell.module';
|
||||
export * from './lib/services/shell-app.service';
|
||||
export * from './lib/components/shell/shell.component';
|
||||
export * from './lib/shell.routes';
|
||||
|
||||
@@ -16,19 +16,11 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { Routes, provideRoutes, Route } from '@angular/router';
|
||||
import { SHELL_LAYOUT_ROUTE } from './shell.routes';
|
||||
import { ShellLayoutComponent } from './components/shell/shell.component';
|
||||
import { Routes, provideRouter } from '@angular/router';
|
||||
import { AppShellRoutesConfig, SHELL_LAYOUT_ROUTE } from './shell.routes';
|
||||
|
||||
export interface AppShellRoutesConfig {
|
||||
shellParentRoute?: Route;
|
||||
shellChildren: Routes;
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [ShellLayoutComponent],
|
||||
exports: [ShellLayoutComponent]
|
||||
})
|
||||
/** @deprecated use `provideShellRoutes` instead */
|
||||
@NgModule()
|
||||
export class ShellModule {
|
||||
static withRoutes(routes: Routes | AppShellRoutesConfig): ModuleWithProviders<ShellModule> {
|
||||
if (Array.isArray(routes)) {
|
||||
@@ -54,7 +46,7 @@ function getModuleForRoutes(routes: Routes): ModuleWithProviders<ShellModule> {
|
||||
|
||||
return {
|
||||
ngModule: ShellModule,
|
||||
providers: provideRoutes([shellLayoutRoute])
|
||||
providers: [provideRouter([shellLayoutRoute])]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,6 +76,6 @@ function getModuleForRouteConfig(config: AppShellRoutesConfig): ModuleWithProvid
|
||||
|
||||
return {
|
||||
ngModule: ShellModule,
|
||||
providers: provideRoutes([rootRoute])
|
||||
providers: [provideRouter([rootRoute])]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Route } from '@angular/router';
|
||||
import { provideRouter, Route, Routes } from '@angular/router';
|
||||
import { ShellLayoutComponent } from './components/shell/shell.component';
|
||||
import { SHELL_AUTH_TOKEN } from './services/shell-app.service';
|
||||
import { EnvironmentProviders } from '@angular/core';
|
||||
|
||||
export const SHELL_LAYOUT_ROUTE: Route = {
|
||||
path: '',
|
||||
@@ -25,3 +26,38 @@ export const SHELL_LAYOUT_ROUTE: Route = {
|
||||
canActivate: [SHELL_AUTH_TOKEN],
|
||||
children: []
|
||||
};
|
||||
|
||||
export interface AppShellRoutesConfig {
|
||||
shellParentRoute?: Route;
|
||||
shellChildren: Routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides shell routes for the application.
|
||||
*
|
||||
* @param routes The routes configuration for the shell.
|
||||
* @returns An array of providers for the shell routes.
|
||||
*/
|
||||
export function provideShellRoutes(routes: Routes | AppShellRoutesConfig): EnvironmentProviders[] {
|
||||
const shellLayoutRoute = SHELL_LAYOUT_ROUTE;
|
||||
|
||||
if (Array.isArray(routes)) {
|
||||
shellLayoutRoute.children.push(...routes);
|
||||
return [provideRouter([shellLayoutRoute])];
|
||||
}
|
||||
|
||||
const shellChildrenRoutes = routes.shellChildren || [];
|
||||
if (shellChildrenRoutes.length > 0) {
|
||||
shellLayoutRoute.children.push(...shellChildrenRoutes);
|
||||
}
|
||||
|
||||
const shellParentRoute = routes.shellParentRoute;
|
||||
const rootRoute = shellParentRoute || shellLayoutRoute;
|
||||
|
||||
if (routes.shellParentRoute) {
|
||||
rootRoute.children = rootRoute.children || [];
|
||||
rootRoute.children.push(shellLayoutRoute);
|
||||
}
|
||||
|
||||
return [provideRouter([rootRoute])];
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AppConfigPipe } from './app-config.pipe';
|
||||
|
||||
/** @deprecated This module is deprecated, consider importing AppConfigPipe directly */
|
||||
@NgModule({
|
||||
imports: [AppConfigPipe],
|
||||
exports: [AppConfigPipe]
|
||||
})
|
||||
/** @deprecated This module is deprecated, consider importing AppConfigPipe directly */
|
||||
export class AppConfigModule {}
|
||||
|
||||
43
lib/core/src/lib/app-config/provide-app-config.ts
Normal file
43
lib/core/src/lib/app-config/provide-app-config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { inject, provideAppInitializer, Provider, EnvironmentProviders } from '@angular/core';
|
||||
import { StoragePrefixFactory } from './app-config-storage-prefix.factory';
|
||||
import { loadAppConfig } from './app-config.loader';
|
||||
import { AppConfigService } from './app-config.service';
|
||||
import { StorageService } from '../common';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
|
||||
/**
|
||||
* Provides the application configuration for the application.
|
||||
*
|
||||
* @returns An array of providers to initialize the application configuration.
|
||||
*/
|
||||
export function provideAppConfig(): (Provider | EnvironmentProviders)[] {
|
||||
return [
|
||||
StoragePrefixFactory,
|
||||
provideAppInitializer(() => {
|
||||
const initializerFn = loadAppConfig(
|
||||
inject(AppConfigService),
|
||||
inject(StorageService),
|
||||
inject(AdfHttpClient),
|
||||
inject(StoragePrefixFactory)
|
||||
);
|
||||
return initializerFn();
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -21,3 +21,4 @@ export * from './app-config.pipe';
|
||||
export * from './app-config-storage-prefix.factory';
|
||||
|
||||
export * from './app-config.module';
|
||||
export * from './provide-app-config';
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { UnitTestingUtils } from '../testing/unit-testing-utils';
|
||||
@@ -119,7 +118,7 @@ testCases.forEach((testCase) => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, TestComponent]
|
||||
imports: [TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixture.componentInstance.isEnabled = false;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule, ModuleWithProviders, inject, provideAppInitializer } from '@angular/core';
|
||||
import { TranslateModule, TranslateLoader, TranslateStore, TranslateService } from '@ngx-translate/core';
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { TranslateLoader, provideTranslateService } from '@ngx-translate/core';
|
||||
import { ABOUT_DIRECTIVES } from './about/about.module';
|
||||
import { CARD_VIEW_DIRECTIVES } from './card-view/card-view.module';
|
||||
import { CONTEXT_MENU_DIRECTIVES } from './context-menu/context-menu.module';
|
||||
@@ -37,29 +37,24 @@ import { NOTIFICATION_HISTORY_DIRECTIVES } from './notifications/notification-hi
|
||||
import { BlankPageComponent } from './blank-page/blank-page.component';
|
||||
import { CORE_DIRECTIVES } from './directives/directive.module';
|
||||
import { CORE_PIPES } from './pipes/pipe.module';
|
||||
import { TranslationService } from './translation/translation.service';
|
||||
import { TranslateLoaderService } from './translation/translate-loader.service';
|
||||
import { SEARCH_TEXT_INPUT_DIRECTIVES } from './search-text/search-text-input.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { AuthenticationInterceptor, Authentication } from '@alfresco/adf-core/auth';
|
||||
import { HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withXsrfConfiguration, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { AuthenticationService } from './auth/services/authentication.service';
|
||||
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
||||
import { loadAppConfig } from './app-config/app-config.loader';
|
||||
import { AppConfigService } from './app-config/app-config.service';
|
||||
import { StorageService } from './common/services/storage.service';
|
||||
import { MomentDateAdapter } from './common/utils/moment-date-adapter';
|
||||
import { AppConfigPipe, StoragePrefixFactory } from './app-config';
|
||||
import { AppConfigPipe } from './app-config';
|
||||
import { IconComponent } from './icon';
|
||||
import { SortingPickerComponent } from './sorting-picker';
|
||||
import { DynamicChipListComponent } from './dynamic-chip-list';
|
||||
import { IdentityUserInfoComponent } from './identity-user-info';
|
||||
import { UnsavedChangesDialogComponent } from './dialogs';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { DecimalRenderMiddlewareService, FORM_FIELD_MODEL_RENDER_MIDDLEWARE } from './form';
|
||||
import { provideAppConfig } from './app-config/provide-app-config';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
TranslateModule,
|
||||
...ABOUT_DIRECTIVES,
|
||||
...VIEWER_DIRECTIVES,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
@@ -87,11 +82,6 @@ import { MaterialModule } from './material.module';
|
||||
BlankPageComponent,
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
HttpClientModule,
|
||||
HttpClientXsrfModule.withOptions({
|
||||
cookieName: 'CSRF-TOKEN',
|
||||
headerName: 'X-CSRF-TOKEN'
|
||||
}),
|
||||
MaterialModule
|
||||
],
|
||||
providers: [...CORE_PIPES],
|
||||
@@ -115,7 +105,6 @@ import { MaterialModule } from './material.module';
|
||||
...LANGUAGE_MENU_DIRECTIVES,
|
||||
...INFO_DRAWER_DIRECTIVES,
|
||||
...DATATABLE_DIRECTIVES,
|
||||
TranslateModule,
|
||||
...TEMPLATE_DIRECTIVES,
|
||||
SortingPickerComponent,
|
||||
IconComponent,
|
||||
@@ -132,20 +121,16 @@ export class CoreModule {
|
||||
return {
|
||||
ngModule: CoreModule,
|
||||
providers: [
|
||||
TranslateStore,
|
||||
TranslateService,
|
||||
{ provide: TranslateLoader, useClass: TranslateLoaderService },
|
||||
MomentDateAdapter,
|
||||
StoragePrefixFactory,
|
||||
provideAppInitializer(() => {
|
||||
const initializerFn = loadAppConfig(
|
||||
inject(AppConfigService),
|
||||
inject(StorageService),
|
||||
inject(AdfHttpClient),
|
||||
inject(StoragePrefixFactory)
|
||||
);
|
||||
return initializerFn();
|
||||
provideTranslateService({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderService,
|
||||
deps: [HttpClient]
|
||||
},
|
||||
defaultLanguage: 'en'
|
||||
}),
|
||||
provideAppConfig(),
|
||||
provideHttpClient(withInterceptorsFromDi(), withXsrfConfiguration({ cookieName: 'CSRF-TOKEN', headerName: 'X-CSRF-TOKEN' })),
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: AuthenticationInterceptor, multi: true },
|
||||
{ provide: Authentication, useClass: AuthenticationService },
|
||||
{
|
||||
@@ -153,6 +138,11 @@ export class CoreModule {
|
||||
useValue: {
|
||||
duration: 10000
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: FORM_FIELD_MODEL_RENDER_MIDDLEWARE,
|
||||
useClass: DecimalRenderMiddlewareService,
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -167,8 +157,4 @@ export class CoreModule {
|
||||
ngModule: CoreModule
|
||||
};
|
||||
}
|
||||
|
||||
constructor(translation: TranslationService) {
|
||||
translation.addTranslationFolder('adf-core', 'assets/adf-core');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import { DataSorting } from '../../data/data-sorting.model';
|
||||
import { ObjectDataColumn } from '../../data/object-datacolumn.model';
|
||||
import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
||||
import { DataTableComponent, ShowHeaderMode } from './datatable.component';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { DataColumnListComponent } from '../../data-column/data-column-list.component';
|
||||
import { DataColumnComponent } from '../../data-column/data-column.component';
|
||||
import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop';
|
||||
@@ -35,6 +34,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-custom-column-template-component',
|
||||
@@ -146,7 +146,8 @@ describe('DataTable', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, CustomColumnHeaderComponent]
|
||||
imports: [CustomColumnHeaderComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
dataTable = fixture.componentInstance;
|
||||
@@ -1291,7 +1292,7 @@ describe('DataTable', () => {
|
||||
expect(dataTable.data.getColumns()).toEqual(expectedNewDataColumns);
|
||||
});
|
||||
|
||||
it('should render the custom column header', () => {
|
||||
it('should render the custom column header', async () => {
|
||||
const customHeader = TestBed.createComponent(CustomColumnHeaderComponent).componentInstance.templateRef;
|
||||
dataTable.data = new ObjectDataTableAdapter(
|
||||
[
|
||||
@@ -1301,6 +1302,7 @@ describe('DataTable', () => {
|
||||
[new ObjectDataColumn({ key: 'id', title: 'ID' }), new ObjectDataColumn({ key: 'name', title: 'Name', header: customHeader })]
|
||||
);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(testingUtils.getInnerTextByDataAutomationId('auto_id_id')).toContain('ID');
|
||||
expect(testingUtils.getInnerTextByDataAutomationId('auto_id_name')).toContain('CUSTOM HEADER');
|
||||
@@ -1518,7 +1520,7 @@ describe('Accessibility', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, CustomColumnTemplateComponent],
|
||||
imports: [CustomColumnTemplateComponent],
|
||||
providers: [{ provide: ConfigurableFocusTrapFactory, useValue: focusTrapFactory }],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
@@ -1752,7 +1754,7 @@ describe('Drag&Drop column header', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, CustomColumnTemplateComponent],
|
||||
imports: [CustomColumnTemplateComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
@@ -1846,7 +1848,7 @@ describe('Show/hide columns', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, CustomColumnTemplateComponent],
|
||||
imports: [CustomColumnTemplateComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
@@ -1954,7 +1956,7 @@ describe('Column Resizing', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, CustomColumnTemplateComponent],
|
||||
imports: [CustomColumnTemplateComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
import { HeaderFilterTemplateDirective } from './header-filter-template.directive';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
|
||||
describe('HeaderFilterTemplateDirective', () => {
|
||||
let fixture: ComponentFixture<DataTableComponent>;
|
||||
@@ -27,7 +26,7 @@ describe('HeaderFilterTemplateDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [DataTableComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
dataTable = fixture.componentInstance;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
import { NoPermissionTemplateDirective } from './no-permission-template.directive';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
|
||||
describe('NoPermissionTemplateDirective', () => {
|
||||
let fixture: ComponentFixture<DataTableComponent>;
|
||||
@@ -27,7 +26,7 @@ describe('NoPermissionTemplateDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [DataTableComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableComponent);
|
||||
dataTable = fixture.componentInstance;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DIALOG_COMPONENT_DATA, DialogComponent } from './dialog.component';
|
||||
import { DialogData } from './dialog-data.interface';
|
||||
import { DialogSize } from './dialog.model';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../testing';
|
||||
import { UnitTestingUtils } from '../../testing';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('DialogComponent', () => {
|
||||
|
||||
const setupBeforeEach = (dialogOptions: DialogData = data) => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, DummyComponent],
|
||||
imports: [DummyComponent],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: dialogOptions },
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigValues, CoreTestingModule, UnsavedChangesDialogComponent, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { AppConfigValues, UnsavedChangesDialogComponent, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogClose } from '@angular/material/dialog';
|
||||
import { UnsavedChangesDialogData } from './unsaved-changes-dialog.model';
|
||||
@@ -30,7 +30,6 @@ describe('UnsavedChangesDialog', () => {
|
||||
|
||||
const setupBeforeEach = (unsavedChangesDialogData?: UnsavedChangesDialogData) => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
providers: [
|
||||
{
|
||||
provide: MAT_DIALOG_DATA,
|
||||
|
||||
@@ -19,7 +19,6 @@ import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { Chip } from './chip';
|
||||
import { DynamicChipListComponent } from './dynamic-chip-list.component';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { UnitTestingUtils } from '../testing/unit-testing-utils';
|
||||
|
||||
describe('DynamicChipListComponent', () => {
|
||||
@@ -65,9 +64,6 @@ describe('DynamicChipListComponent', () => {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
const resizeObserverSpy = spyOn(window, 'ResizeObserver').and.callThrough();
|
||||
fixture = TestBed.createComponent(DynamicChipListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { FormRenderingService } from '../../services/form-rendering.service';
|
||||
import { CheckboxWidgetComponent, FormFieldModel, FormFieldTypes, FormModel, TextWidgetComponent } from '../widgets';
|
||||
import { FormFieldComponent } from './form-field.component';
|
||||
@@ -31,7 +31,7 @@ describe('FormFieldComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [FormFieldComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormFieldComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../testing';
|
||||
import { UnitTestingUtils } from '../../testing';
|
||||
import { FormRulesManager } from '../models/form-rules.model';
|
||||
import { FormRenderingService } from '../services/form-rendering.service';
|
||||
import { FormService } from '../services/form.service';
|
||||
@@ -90,7 +90,7 @@ describe('Form Renderer Component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [FormRendererComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormRendererComponent);
|
||||
formRendererComponent = fixture.componentInstance;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { FormFieldModel, FormModel } from '../widgets';
|
||||
import { FormSectionComponent } from './form-section.component';
|
||||
import { mockSectionWithFields } from '../mock/form-renderer.component.mock';
|
||||
@@ -28,7 +28,7 @@ describe('FormSectionComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [FormSectionComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormSectionComponent);
|
||||
testingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { InplaceFormInputComponent } from './inplace-form-input.component';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
|
||||
describe('InplaceFormInputComponent', () => {
|
||||
let component: InplaceFormInputComponent;
|
||||
@@ -26,13 +26,10 @@ describe('InplaceFormInputComponent', () => {
|
||||
let formControl: UntypedFormControl;
|
||||
let testingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, InplaceFormInputComponent]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [InplaceFormInputComponent]
|
||||
});
|
||||
formControl = new UntypedFormControl('');
|
||||
fixture = TestBed.createComponent(InplaceFormInputComponent);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
import { AmountWidgetComponent, ADF_AMOUNT_SETTINGS } from './amount.widget';
|
||||
import { FormBaseModule } from '../../../form-base.module';
|
||||
import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
@@ -33,7 +32,7 @@ describe('AmountWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [FormBaseModule]
|
||||
imports: [AmountWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AmountWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
@@ -131,7 +130,7 @@ describe('AmountWidgetComponent - rendering', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [FormBaseModule]
|
||||
imports: [AmountWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AmountWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
@@ -336,7 +335,7 @@ describe('AmountWidgetComponent settings', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [FormBaseModule],
|
||||
imports: [AmountWidgetComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: ADF_AMOUNT_SETTINGS,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../../../../testing';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldModel, FormModel } from '../core';
|
||||
import { BaseViewerWidgetComponent } from './base-viewer.widget';
|
||||
@@ -44,7 +43,7 @@ describe('BaseViewerWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, BaseViewerWidgetComponent],
|
||||
imports: [BaseViewerWidgetComponent],
|
||||
providers: [{ provide: FormService, useValue: formServiceStub }]
|
||||
});
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { TranslateLoader } from '@ngx-translate/core';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { TranslateLoaderService } from '../../../../translation';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from '../core';
|
||||
import { CheckboxWidgetComponent } from './checkbox.widget';
|
||||
|
||||
@@ -33,8 +31,7 @@ describe('CheckboxWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MatCheckboxModule],
|
||||
providers: [{ provide: TranslateLoader, useClass: TranslateLoaderService }]
|
||||
imports: [MatCheckboxModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(CheckboxWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -25,16 +25,11 @@ import { FormOutcomeModel } from './form-outcome.model';
|
||||
import { FormModel } from './form.model';
|
||||
import { TabModel } from './tab.model';
|
||||
import { fakeMetadataForm, mockDisplayExternalPropertyForm, mockFormWithSections, fakeValidatorMock } from '../../mock/form.mock';
|
||||
import { CoreTestingModule } from '../../../../testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
describe('FormModel', () => {
|
||||
let formService: FormService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
formService = new FormService();
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from '../core';
|
||||
import { DateWidgetComponent } from './date.widget';
|
||||
import { DEFAULT_DATE_FORMAT } from '../../../../common';
|
||||
@@ -32,7 +32,7 @@ describe('DateWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [DateWidgetComponent]
|
||||
});
|
||||
|
||||
form = new FormModel();
|
||||
|
||||
@@ -19,7 +19,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from '../core';
|
||||
import { DecimalWidgetComponent } from './decimal.component';
|
||||
@@ -30,11 +30,11 @@ describe('DecimalComponent', () => {
|
||||
let fixture: ComponentFixture<DecimalWidgetComponent>;
|
||||
let testingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MatInputModule, DecimalWidgetComponent],
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MatInputModule, DecimalWidgetComponent],
|
||||
providers: [FormService]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(DecimalWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { SimpleChange, SimpleChanges } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { ErrorMessageModel } from '../core';
|
||||
import { ErrorWidgetComponent } from './error.component';
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('ErrorWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [ErrorWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(ErrorWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from '../core';
|
||||
import { HyperlinkWidgetComponent } from './hyperlink.widget';
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('HyperlinkWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [HyperlinkWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(HyperlinkWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -20,7 +20,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../../testing';
|
||||
import { UnitTestingUtils } from '../../../../testing';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from '../core';
|
||||
import { NumberWidgetComponent } from './number.widget';
|
||||
import { DecimalNumberPipe } from '../../../../pipes';
|
||||
@@ -36,7 +36,7 @@ describe('NumberWidgetComponent', () => {
|
||||
mockDecimalNumberPipe = jasmine.createSpyObj('DecimalNumberPipe', ['transform']);
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MatInputModule, MatIconModule]
|
||||
imports: [MatInputModule, MatIconModule]
|
||||
})
|
||||
.overrideComponent(NumberWidgetComponent, {
|
||||
set: {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { CoreTestingModule } from '../../../testing';
|
||||
import { FormRulesEvent } from '../../events';
|
||||
import { FormFieldModel, FormModel } from './core';
|
||||
import { WidgetComponent } from './widget.component';
|
||||
@@ -29,7 +28,7 @@ describe('WidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [WidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(WidgetComponent);
|
||||
|
||||
|
||||
@@ -20,10 +20,9 @@ import { StartFormCustomButtonDirective } from './components/form-custom-button.
|
||||
import { FormFieldComponent } from './components/form-field/form-field.component';
|
||||
import { FormRendererComponent } from './components/form-renderer.component';
|
||||
import { InplaceFormInputComponent } from './components/inplace-form-input/inplace-form-input.component';
|
||||
import { DecimalRenderMiddlewareService } from './components/middlewares/decimal-middleware.service';
|
||||
import { FORM_FIELD_MODEL_RENDER_MIDDLEWARE } from './components/middlewares/middleware';
|
||||
import { MASK_DIRECTIVE, WIDGET_DIRECTIVES, WidgetComponent } from './components/widgets';
|
||||
|
||||
/** @deprecated This module is deprecated and will be removed in a future release. Use standalone components instead. */
|
||||
@NgModule({
|
||||
imports: [
|
||||
FormFieldComponent,
|
||||
@@ -34,7 +33,6 @@ import { MASK_DIRECTIVE, WIDGET_DIRECTIVES, WidgetComponent } from './components
|
||||
...WIDGET_DIRECTIVES,
|
||||
...MASK_DIRECTIVE
|
||||
],
|
||||
declarations: [],
|
||||
exports: [
|
||||
FormFieldComponent,
|
||||
FormRendererComponent,
|
||||
@@ -42,13 +40,6 @@ import { MASK_DIRECTIVE, WIDGET_DIRECTIVES, WidgetComponent } from './components
|
||||
...WIDGET_DIRECTIVES,
|
||||
InplaceFormInputComponent,
|
||||
WidgetComponent
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: FORM_FIELD_MODEL_RENDER_MIDDLEWARE,
|
||||
useClass: DecimalRenderMiddlewareService,
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
})
|
||||
export class FormBaseModule {}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { Injector } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { getTestScheduler } from 'jasmine-marbles';
|
||||
import { CoreTestingModule } from '../../testing';
|
||||
import { FormModel } from '../components/widgets';
|
||||
import { FormEvent, FormRulesEvent } from '../events';
|
||||
import { FormService } from '../services/form.service';
|
||||
@@ -42,7 +41,6 @@ describe('Form Rules', () => {
|
||||
describe('Injection token provided', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
providers: [
|
||||
{
|
||||
provide: FORM_RULES_MANAGER,
|
||||
@@ -106,9 +104,6 @@ describe('Form Rules', () => {
|
||||
let getRulesSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
injector = TestBed.inject(Injector);
|
||||
rulesManager = formRulesManagerFactory<any>(injector);
|
||||
getRulesSpy = spyOn<any>(rulesManager, 'getRules');
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { formModelTabs } from '../../mock';
|
||||
import { FORM_SERVICE_FIELD_VALIDATORS_TOKEN, FormService } from './form.service';
|
||||
import { CoreTestingModule } from '../../testing';
|
||||
import { FORM_FIELD_VALIDATORS, FormFieldValidator } from '../public-api';
|
||||
|
||||
const fakeValidator = {
|
||||
@@ -32,7 +31,7 @@ describe('Form service', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [],
|
||||
providers: [{ provide: FORM_SERVICE_FIELD_VALIDATORS_TOKEN, useValue: [fakeValidator] }]
|
||||
});
|
||||
service = TestBed.inject(FormService);
|
||||
|
||||
@@ -28,7 +28,6 @@ import {
|
||||
complexVisibilityJsonNotVisible,
|
||||
headerVisibilityCond
|
||||
} from '../../mock/form/widget-visibility-cloud.service.mock';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -39,9 +38,6 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
const stubFormWithFields = new FormModel(fakeFormJson);
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
service = TestBed.inject(WidgetVisibilityService);
|
||||
jasmine.Ajax.install();
|
||||
});
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
fakeFormChainedVisibilityJson,
|
||||
fakeFormCheckBoxVisibilityJson
|
||||
} from '../../mock/form/widget-visibility.service.mock';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
|
||||
describe('WidgetVisibilityService', () => {
|
||||
let service: WidgetVisibilityService;
|
||||
@@ -48,9 +47,6 @@ describe('WidgetVisibilityService', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
service = TestBed.inject(WidgetVisibilityService);
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IdentityUserInfoComponent } from './identity-user-info.component';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { IdentityUserModel } from '../auth/models/identity-user.model';
|
||||
import { UnitTestingUtils } from '../testing/unit-testing-utils';
|
||||
@@ -51,7 +50,7 @@ describe('IdentityUserInfoComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MatMenuModule, IdentityUserInfoComponent]
|
||||
imports: [MatMenuModule, IdentityUserInfoComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(IdentityUserInfoComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { UserPreferencesService } from '../common/services/user-preferences.service';
|
||||
import { LanguageService } from './service/language.service';
|
||||
|
||||
@@ -47,7 +46,7 @@ describe('LanguageMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, LanguageMenuComponent]
|
||||
imports: [LanguageMenuComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(LanguageMenuComponent);
|
||||
|
||||
@@ -20,17 +20,17 @@ import { LanguagePickerComponent } from './language-picker.component';
|
||||
import { MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
import { QueryList } from '@angular/core';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
|
||||
describe('LanguagePickerComponent', () => {
|
||||
let component: LanguagePickerComponent;
|
||||
let fixture: ComponentFixture<LanguagePickerComponent>;
|
||||
let testingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, LanguagePickerComponent]
|
||||
}).compileComponents();
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [LanguagePickerComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(LanguagePickerComponent);
|
||||
testingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { HeaderLayoutComponent } from './header.component';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { Component } from '@angular/core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('HeaderLayoutComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -32,7 +32,8 @@ describe('HeaderLayoutComponent', () => {
|
||||
describe('Input parameters', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, HeaderLayoutComponent]
|
||||
imports: [HeaderLayoutComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(HeaderLayoutComponent);
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
@@ -248,7 +249,8 @@ describe('HeaderLayoutComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, HeaderLayoutTesterComponent]
|
||||
imports: [HeaderLayoutTesterComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SidebarActionMenuComponent } from './sidebar-action-menu.component';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
@@ -31,7 +30,7 @@ describe('SidebarActionMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, SidebarActionMenuComponent]
|
||||
imports: [SidebarActionMenuComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SidebarActionMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
@@ -86,7 +85,7 @@ describe('Custom SidebarActionMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, SidebarActionMenuComponent, CustomSidebarActionMenuComponent]
|
||||
imports: [SidebarActionMenuComponent, CustomSidebarActionMenuComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(CustomSidebarActionMenuComponent);
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -21,7 +21,7 @@ import { OidcAuthenticationService } from '../../../auth/oidc/oidc-authenticatio
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { LoginDialogPanelComponent } from './login-dialog-panel.component';
|
||||
import { BasicAlfrescoAuthService } from '../../../auth/basic-auth/basic-alfresco-auth.service';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('LoginDialogPanelComponent', () => {
|
||||
let component: LoginDialogPanelComponent;
|
||||
@@ -33,7 +33,7 @@ describe('LoginDialogPanelComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [NoopAuthModule, LoginDialogPanelComponent],
|
||||
providers: [{ provide: OidcAuthenticationService, useValue: {} }]
|
||||
});
|
||||
fixture = TestBed.createComponent(LoginDialogPanelComponent);
|
||||
|
||||
@@ -26,9 +26,12 @@ import { UserPreferencesService } from '../../../common/services/user-preference
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { BasicAlfrescoAuthService } from '../../../auth/basic-auth/basic-alfresco-auth.service';
|
||||
import { UnitTestingUtils } from '../../../testing/unit-testing-utils';
|
||||
import { CoreTestingModule } from '../../../testing/core.testing.module';
|
||||
import { LoginSuccessEvent } from '../../models/login-success.event';
|
||||
import { LoginErrorEvent } from '../../models/login-error.event';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { NoopAuthModule } from '../../../testing/noop-auth.module';
|
||||
import { TranslationService } from '../../../translation/translation.service';
|
||||
import { NoopTranslationService } from '../../../testing/noop-translate.module';
|
||||
|
||||
describe('LoginComponent', () => {
|
||||
let component: LoginComponent;
|
||||
@@ -58,8 +61,10 @@ describe('LoginComponent', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [NoopAuthModule, LoginComponent],
|
||||
providers: [
|
||||
provideHttpClientTesting(),
|
||||
{ provide: TranslationService, useClass: NoopTranslationService },
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
useValue: {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CoreTestingModule, LoginComponent, LoginFooterDirective } from '@alfresco/adf-core';
|
||||
import { LoginComponent, LoginFooterDirective, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { OidcAuthenticationService } from '../../auth/oidc/oidc-authentication.service';
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('LoginFooterDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [NoopAuthModule, LoginComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CoreTestingModule, LoginComponent, LoginHeaderDirective } from '@alfresco/adf-core';
|
||||
import { LoginComponent, LoginHeaderDirective, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { OidcAuthenticationService } from '../../auth/oidc/oidc-authentication.service';
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('LoginHeaderDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [NoopAuthModule, LoginComponent],
|
||||
providers: [{ provide: OidcAuthenticationService, useValue: {} }]
|
||||
});
|
||||
fixture = TestBed.createComponent(LoginComponent);
|
||||
|
||||
@@ -20,7 +20,6 @@ import { PaginationModel } from '../models/pagination.model';
|
||||
import { InfinitePaginationComponent } from './infinite-pagination.component';
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { Component, ChangeDetectorRef } from '@angular/core';
|
||||
import { RequestPaginationModel } from '../models/request-pagination.model';
|
||||
import { UnitTestingUtils } from '../testing/unit-testing-utils';
|
||||
@@ -59,7 +58,7 @@ describe('InfinitePaginationComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, TestPaginatedComponent]
|
||||
imports: [TestPaginatedComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(InfinitePaginationComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { UserPreferencesService } from '../common/services/user-preferences.service';
|
||||
import { of } from 'rxjs';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { DecimalNumberPipe } from './decimal-number.pipe';
|
||||
import { Injector, runInInjectionContext } from '@angular/core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
@@ -28,9 +27,6 @@ describe('DecimalNumberPipe', () => {
|
||||
let userPreferences: UserPreferencesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
userPreferences = TestBed.inject(UserPreferencesService);
|
||||
const injector = TestBed.inject(Injector);
|
||||
spyOn(userPreferences, 'select').and.returnValue(of(''));
|
||||
|
||||
@@ -20,7 +20,6 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { UserPreferencesService } from '../common/services/user-preferences.service';
|
||||
import { of } from 'rxjs';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
registerLocaleData(localeFr);
|
||||
@@ -30,9 +29,6 @@ describe('LocalizedDatePipe', () => {
|
||||
let userPreferences: UserPreferencesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
userPreferences = TestBed.inject(UserPreferencesService);
|
||||
spyOn(userPreferences, 'select').and.returnValue(of(''));
|
||||
pipe = new LocalizedDatePipe(userPreferences, TestBed.inject(AppConfigService));
|
||||
|
||||
@@ -17,14 +17,13 @@
|
||||
|
||||
import { MultiValuePipe } from './multi-value.pipe';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
describe('MultiValuePipe', () => {
|
||||
let pipe: MultiValuePipe;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MultiValuePipe],
|
||||
imports: [MultiValuePipe],
|
||||
providers: [MultiValuePipe]
|
||||
});
|
||||
pipe = TestBed.inject(MultiValuePipe);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { TimeAgoPipe } from './time-ago.pipe';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { UserPreferencesService } from '../common/services/user-preferences.service';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { Injector, runInInjectionContext } from '@angular/core';
|
||||
|
||||
@@ -28,9 +27,6 @@ describe('TimeAgoPipe', () => {
|
||||
let userPreferences: UserPreferencesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
userPreferences = TestBed.inject(UserPreferencesService);
|
||||
const injector = TestBed.inject(Injector);
|
||||
spyOn(userPreferences, 'select').and.returnValue(of(''));
|
||||
|
||||
@@ -17,16 +17,12 @@
|
||||
|
||||
import { TruncatePipe } from './truncate.pipe';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { Injector, runInInjectionContext } from '@angular/core';
|
||||
|
||||
describe('TruncatePipe', () => {
|
||||
let pipe: TruncatePipe;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
const injector = TestBed.inject(Injector);
|
||||
runInInjectionContext(injector, () => {
|
||||
pipe = new TruncatePipe();
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed, discardPeriodicTasks, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { SearchTextInputComponent } from './search-text-input.component';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
@@ -32,7 +31,7 @@ describe('SearchTextInputComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [SearchTextInputComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchTextInputComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -20,7 +20,6 @@ import { MatIcon } from '@angular/material/icon';
|
||||
import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar';
|
||||
import { SnackbarContentComponent } from './snackbar-content.component';
|
||||
import { UnitTestingUtils } from '../testing/unit-testing-utils';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
describe('SnackbarContentComponent', () => {
|
||||
let component: SnackbarContentComponent;
|
||||
@@ -29,7 +28,7 @@ describe('SnackbarContentComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, SnackbarContentComponent],
|
||||
imports: [SnackbarContentComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: MatSnackBarRef,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||
import { ErrorContentComponent } from './error-content.component';
|
||||
import { TranslationService } from '../../translation/translation.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -31,7 +30,7 @@ describe('ErrorContentComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [ErrorContentComponent],
|
||||
providers: [{ provide: ActivatedRoute, useValue: { params: of() } }]
|
||||
});
|
||||
fixture = TestBed.createComponent(ErrorContentComponent);
|
||||
|
||||
@@ -21,6 +21,7 @@ import { CoreModule } from '../core.module';
|
||||
import { NoopTranslateModule } from './noop-translate.module';
|
||||
import { NoopAuthModule } from './noop-auth.module';
|
||||
|
||||
/** @deprecated this module is deprecated and will be removed in the future */
|
||||
@NgModule({
|
||||
imports: [NoopAnimationsModule, CoreModule.forRoot(), NoopTranslateModule, NoopAuthModule]
|
||||
})
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { EventEmitter, Injectable, NgModule } from '@angular/core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { provideTranslateService, TranslateLoader } from '@ngx-translate/core';
|
||||
import { TranslationService } from '../translation/translation.service';
|
||||
import { LangChangeEvent } from '../mock';
|
||||
import { Observable, of } from 'rxjs';
|
||||
@@ -47,8 +47,15 @@ export class NoopTranslationService implements TranslationService {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [HttpClientTestingModule, TranslateModule.forRoot()],
|
||||
providers: [{ provide: TranslationService, useClass: NoopTranslationService }],
|
||||
exports: [TranslateModule]
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: NoopTranslationService },
|
||||
provideTranslateService({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: NoopTranslationService
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
export class NoopTranslateModule {}
|
||||
|
||||
@@ -29,7 +29,12 @@ import { map, catchError, retry } from 'rxjs/operators';
|
||||
export class TranslateLoaderService implements TranslateLoader {
|
||||
private prefix: string = 'i18n';
|
||||
private suffix: string = '.json';
|
||||
private providers: ComponentTranslationModel[] = [];
|
||||
private providers: ComponentTranslationModel[] = [
|
||||
new ComponentTranslationModel({
|
||||
name: 'adf-core',
|
||||
path: 'assets/adf-core'
|
||||
})
|
||||
];
|
||||
private queue: string[][] = [];
|
||||
private defaultLang: string = 'en';
|
||||
|
||||
|
||||
@@ -18,11 +18,8 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { AuthModule } from '../auth/oidc/auth.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
import { provideTranslateService, TranslateLoader } from '@ngx-translate/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
describe('TranslateLoader', () => {
|
||||
let translationService: TranslationService;
|
||||
@@ -30,17 +27,20 @@ describe('TranslateLoader', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AuthModule.forRoot({ useHash: true }), TranslateModule.forRoot(), CoreModule.forRoot()],
|
||||
providers: [TranslationService]
|
||||
providers: [
|
||||
provideTranslateService({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderService,
|
||||
deps: [HttpClient]
|
||||
},
|
||||
defaultLanguage: 'en'
|
||||
}),
|
||||
TranslationService
|
||||
]
|
||||
});
|
||||
translationService = TestBed.inject(TranslationService);
|
||||
customLoader = translationService.translate.currentLoader as TranslateLoaderService;
|
||||
|
||||
jasmine.Ajax.install();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jasmine.Ajax.uninstall();
|
||||
});
|
||||
|
||||
it('should be able to provide any TranslateLoader', () => {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { DownloadPromptActions } from '../../models/download-prompt.actions';
|
||||
import { DownloadPromptDialogComponent } from './download-prompt-dialog.component';
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('DownloadPromptDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, DownloadPromptDialogComponent],
|
||||
imports: [DownloadPromptDialogComponent],
|
||||
providers: [{ provide: MatDialogRef, useValue: mockDialog }]
|
||||
});
|
||||
matDialogRef = TestBed.inject(MatDialogRef);
|
||||
|
||||
@@ -19,7 +19,7 @@ import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../../../app-config';
|
||||
import { UrlService } from '../../../common';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { ImgViewerComponent } from './img-viewer.component';
|
||||
|
||||
describe('Test Img viewer component ', () => {
|
||||
@@ -33,12 +33,6 @@ describe('Test Img viewer component ', () => {
|
||||
return new Blob([data], { type: 'image/png' });
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
});
|
||||
});
|
||||
|
||||
describe('Zoom customization', () => {
|
||||
beforeEach(() => {
|
||||
urlService = TestBed.inject(UrlService);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { CoreTestingModule } from '../../../testing';
|
||||
import { PdfPasswordDialogComponent } from './pdf-viewer-password-dialog';
|
||||
|
||||
declare const pdfjsLib: any;
|
||||
@@ -29,7 +28,7 @@ describe('PdfPasswordDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [PdfPasswordDialogComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: MAT_DIALOG_DATA,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PdfThumbComponent } from './pdf-viewer-thumb.component';
|
||||
import { CoreTestingModule } from '../../../testing';
|
||||
|
||||
describe('PdfThumbComponent', () => {
|
||||
let fixture: ComponentFixture<PdfThumbComponent>;
|
||||
@@ -42,7 +41,7 @@ describe('PdfThumbComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [PdfThumbComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: DomSanitizer,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PdfThumbListComponent } from './pdf-viewer-thumbnails.component';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { DOWN_ARROW, ESCAPE, UP_ARROW } from '@angular/cdk/keycodes';
|
||||
|
||||
declare const pdfjsViewer: any;
|
||||
@@ -72,7 +72,7 @@ describe('PdfThumbListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [PdfThumbListComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(PdfThumbListComponent);
|
||||
testingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TxtViewerComponent } from './txt-viewer.component';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
||||
import { UnitTestingUtils } from '../../../testing';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('Text View component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, TxtViewerComponent]
|
||||
imports: [TxtViewerComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TxtViewerComponent);
|
||||
testingUtils = new UnitTestingUtils(fixture.debugElement);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { UnknownFormatComponent } from './unknown-format.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('Unknown Format Component', () => {
|
||||
let fixture: ComponentFixture<UnknownFormatComponent>;
|
||||
@@ -26,7 +25,7 @@ describe('Unknown Format Component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [UnknownFormatComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(UnknownFormatComponent);
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
|
||||
import { Component, DebugElement, SimpleChanges } from '@angular/core';
|
||||
import { ComponentFixture, discardPeriodicTasks, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { of } from 'rxjs';
|
||||
import { AppConfigService } from '../../app-config';
|
||||
import { EventMock } from '../../mock';
|
||||
import { CoreTestingModule, UnitTestingUtils } from '../../testing';
|
||||
import { UnitTestingUtils } from '../../testing';
|
||||
import { DownloadPromptActions } from '../models/download-prompt.actions';
|
||||
import { CloseButtonPosition } from '../models/viewer.model';
|
||||
import { ViewUtilService } from '../services/view-util.service';
|
||||
@@ -58,9 +56,6 @@ describe('ViewerComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreTestingModule,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
ViewerWithCustomToolbarComponent,
|
||||
ViewerWithCustomSidebarComponent,
|
||||
ViewerWithCustomOpenWithComponent,
|
||||
|
||||
@@ -21,7 +21,6 @@ import { ChangeDetectorRef, ElementRef } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ViewerRenderComponent } from '../components/viewer-render/viewer-render.component';
|
||||
import { ViewerExtensionDirective } from './viewer-extension.directive';
|
||||
import { CoreTestingModule } from '../../testing';
|
||||
|
||||
describe('ExtensionViewerDirective', () => {
|
||||
let extensionViewerDirective: ViewerExtensionDirective;
|
||||
@@ -35,7 +34,7 @@ describe('ExtensionViewerDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
imports: [ViewerRenderComponent],
|
||||
providers: [
|
||||
{ provide: Location, useClass: SpyLocation },
|
||||
ViewerExtensionDirective,
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { fakeApplicationInstance } from '../../mock/app-model.mock';
|
||||
import { AppDetailsCloudComponent } from './app-details-cloud.component';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { DEFAULT_APP_INSTANCE_THEME } from '../../models/application-instance.model';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('AppDetailsCloudComponent', () => {
|
||||
let component: AppDetailsCloudComponent;
|
||||
@@ -28,7 +28,7 @@ describe('AppDetailsCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, AppDetailsCloudComponent]
|
||||
imports: [NoopTranslateModule, AppDetailsCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AppDetailsCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -22,9 +22,8 @@ import { of, throwError } from 'rxjs';
|
||||
import { fakeApplicationInstance } from '../../mock/app-model.mock';
|
||||
import { AppListCloudComponent, LAYOUT_GRID, LAYOUT_LIST } from './app-list-cloud.component';
|
||||
import { AppsProcessCloudService } from '../../services/apps-process-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { CustomEmptyContentTemplateDirective } from '@alfresco/adf-core';
|
||||
import { CustomEmptyContentTemplateDirective, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('AppListCloudComponent', () => {
|
||||
let component: AppListCloudComponent;
|
||||
@@ -56,7 +55,7 @@ describe('AppListCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, AppListCloudComponent, CustomEmptyAppListCloudTemplateComponent]
|
||||
imports: [NoopTranslateModule, AppListCloudComponent, CustomEmptyAppListCloudTemplateComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AppListCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -18,11 +18,10 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { AppConfigService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { HttpErrorResponse, provideHttpClient } from '@angular/common/http';
|
||||
import { AppsProcessCloudService } from './apps-process-cloud.service';
|
||||
import { fakeApplicationInstance, fakeApplicationInstanceWithEnvironment } from '../mock/app-model.mock';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { fakeEnvironmentList } from '../../common/mock/environment.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
|
||||
@@ -37,8 +36,7 @@ describe('AppsProcessCloudService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ProcessServiceCloudTestingModule],
|
||||
providers: [AlfrescoApiService, AppConfigService]
|
||||
providers: [provideHttpClient(), AlfrescoApiService, AppConfigService]
|
||||
});
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
spyOn(adfHttpClient, 'request').and.returnValue(apiMockResponse);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { DateRangeFilterComponent } from './date-range-filter.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { DateCloudFilterType } from '../../models/date-cloud-filter.model';
|
||||
import { DateRangeFilterService } from './date-range-filter.service';
|
||||
@@ -28,6 +27,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||
import { MatDateRangeInputHarness } from '@angular/material/datepicker/testing';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('DateRangeFilterComponent', () => {
|
||||
let component: DateRangeFilterComponent;
|
||||
@@ -37,7 +37,7 @@ describe('DateRangeFilterComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, DateRangeFilterComponent]
|
||||
imports: [NoopTranslateModule, DateRangeFilterComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(DateRangeFilterComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormModel } from '@alfresco/adf-core';
|
||||
import { FormModel, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { FormCloudComponent } from './form-cloud.component';
|
||||
import { FormCustomOutcomesComponent } from './form-cloud-custom-outcomes.component';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -49,7 +48,7 @@ describe('FormCloudWithCustomOutComesComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, FormCloudWithCustomOutComesComponent]
|
||||
imports: [NoopTranslateModule, FormCloudWithCustomOutComesComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormCloudWithCustomOutComesComponent);
|
||||
customComponent = fixture.componentInstance;
|
||||
|
||||
@@ -45,7 +45,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDialogHarness } from '@angular/material/dialog/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateLoader, TranslateService, provideTranslateService } from '@ngx-translate/core';
|
||||
import { Observable, of, throwError } from 'rxjs';
|
||||
import {
|
||||
@@ -64,7 +63,6 @@ import { FORM_CLOUD_FIELD_VALIDATORS_TOKEN, FormCloudComponent } from './form-cl
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { FormCloudDisplayMode } from '../../services/form-fields.interfaces';
|
||||
import { CloudFormRenderingService } from './cloud-form-rendering.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
||||
|
||||
const mockOauth2Auth: any = {
|
||||
@@ -114,7 +112,7 @@ describe('FormCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, FormCloudComponent],
|
||||
imports: [NoopTranslateModule, NoopAuthModule, FormCloudComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: VersionCompatibilityService,
|
||||
@@ -1541,7 +1539,7 @@ describe('Multilingual Form', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, NoopAuthModule],
|
||||
imports: [NoopAuthModule],
|
||||
providers: [
|
||||
provideTranslateService({
|
||||
loader: {
|
||||
@@ -1616,7 +1614,7 @@ describe('retrieve metadata on submit', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, NoopTranslateModule, CoreModule.forRoot(), FormCloudComponent],
|
||||
imports: [AuthModule.forRoot({ useHash: true }), CoreModule.forRoot(), FormCloudComponent],
|
||||
providers: [
|
||||
provideTranslations('app', 'resources'),
|
||||
{
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { FormDefinitionSelectorCloudComponent } from './form-definition-selector-cloud.component';
|
||||
import { of } from 'rxjs';
|
||||
import { FormDefinitionSelectorCloudService } from '../services/form-definition-selector-cloud.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('FormDefinitionCloudComponent', () => {
|
||||
let fixture: ComponentFixture<FormDefinitionSelectorCloudComponent>;
|
||||
@@ -32,7 +32,7 @@ describe('FormDefinitionCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, FormDefinitionSelectorCloudComponent]
|
||||
imports: [NoopTranslateModule, FormDefinitionSelectorCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormDefinitionSelectorCloudComponent);
|
||||
service = TestBed.inject(FormDefinitionSelectorCloudService);
|
||||
|
||||
@@ -29,7 +29,9 @@ import {
|
||||
FormService,
|
||||
LocalizedDatePipe,
|
||||
NotificationService,
|
||||
UploadWidgetContentLinkModel
|
||||
UploadWidgetContentLinkModel,
|
||||
NoopTranslateModule,
|
||||
NoopAuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import {
|
||||
allSourceParams,
|
||||
@@ -59,9 +61,14 @@ import {
|
||||
onlyLocalParams,
|
||||
processVariables
|
||||
} from '../../../mocks/attach-file-cloud-widget.mock';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { Injector, runInInjectionContext } from '@angular/core';
|
||||
import { ContentNodeSelectorPanelService, NewVersionUploaderDataAction, NewVersionUploaderService } from '@alfresco/adf-content-services';
|
||||
import {
|
||||
ContentNodeSelectorPanelService,
|
||||
NewVersionUploaderDataAction,
|
||||
NewVersionUploaderService,
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
|
||||
@@ -143,7 +150,8 @@ describe('AttachFileCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, AttachFileCloudWidgetComponent]
|
||||
imports: [NoopTranslateModule, NoopAuthModule, AttachFileCloudWidgetComponent],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
notificationService = TestBed.inject(NotificationService);
|
||||
downloadService = TestBed.inject(DownloadService);
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../../testing/process-service-cloud.testing.module';
|
||||
import { FilePropertiesTableCloudComponent } from './file-properties-table-cloud.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('FilePropertiesTableCloudComponent', () => {
|
||||
let widget: FilePropertiesTableCloudComponent;
|
||||
@@ -27,7 +27,7 @@ describe('FilePropertiesTableCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, FilePropertiesTableCloudComponent]
|
||||
imports: [NoopTranslateModule, FilePropertiesTableCloudComponent]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DataColumn, DataRow, FormFieldModel, FormFieldTypes, FormModel, FormService, ObjectDataRow, VariableConfig } from '@alfresco/adf-core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DataTableWidgetComponent } from './data-table.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { TaskVariableCloud } from '../../../models/task-variable-cloud.model';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import {
|
||||
@@ -85,9 +84,6 @@ describe('DataTableWidgetComponent', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(DataTableWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DateCloudWidgetComponent } from './date-cloud.widget';
|
||||
import { FormFieldModel, FormModel, FormFieldTypes, DEFAULT_DATE_FORMAT } from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { FormFieldModel, FormModel, FormFieldTypes, DEFAULT_DATE_FORMAT, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { isEqual, subDays, addDays } from 'date-fns';
|
||||
import { UnitTestingUtils } from '../../../../../../../core/src/lib/testing/unit-testing-utils';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
|
||||
@@ -36,7 +34,7 @@ describe('DateCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [DateCloudWidgetComponent]
|
||||
});
|
||||
|
||||
form = new FormModel();
|
||||
|
||||
@@ -15,17 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormService, FormFieldModel, FormModel, FormFieldTypes } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormModel, FormFieldTypes, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { DisplayExternalPropertyWidgetComponent } from './display-external-property.widget';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { UnitTestingUtils } from '../../../../../../../core/src/lib/testing/unit-testing-utils';
|
||||
|
||||
describe('DisplayExternalPropertyWidgetComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -37,9 +34,8 @@ describe('DisplayExternalPropertyWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, ReactiveFormsModule, DisplayExternalPropertyWidgetComponent],
|
||||
providers: [FormService]
|
||||
}).compileComponents();
|
||||
imports: [DisplayExternalPropertyWidgetComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(DisplayExternalPropertyWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { DisplayRichTextWidgetComponent } from './display-rich-text.widget';
|
||||
|
||||
describe('DisplayRichTextWidgetComponent', () => {
|
||||
@@ -81,7 +80,7 @@ describe('DisplayRichTextWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, DisplayRichTextWidgetComponent]
|
||||
imports: [DisplayRichTextWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(DisplayRichTextWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -19,9 +19,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { DEFAULT_OPTION, DropdownCloudWidgetComponent } from './dropdown-cloud.widget';
|
||||
import { FormFieldModel, FormModel, FormService, FormFieldEvent, FormFieldTypes } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormModel, FormService, FormFieldEvent, FormFieldTypes, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import {
|
||||
fakeOptionList,
|
||||
filterOptionList,
|
||||
@@ -38,7 +37,6 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { FormUtilsService } from '../../../services/form-utils.service';
|
||||
import { UnitTestingUtils } from '../../../../../../../core/src/public-api';
|
||||
|
||||
describe('DropdownCloudWidgetComponent', () => {
|
||||
let formService: FormService;
|
||||
@@ -52,7 +50,7 @@ describe('DropdownCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [DropdownCloudWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(DropdownCloudWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormFieldModel, FormFieldTypes, FormModel, IdentityGroupModel } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel, IdentityGroupModel, NoopAuthModule, CoreModule } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { GroupCloudWidgetComponent } from './group-cloud.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
@@ -31,7 +30,7 @@ describe('GroupCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, GroupCloudWidgetComponent]
|
||||
imports: [CoreModule.forRoot(), NoopAuthModule, GroupCloudWidgetComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(GroupCloudWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FormFieldModel, FormFieldTypes, FormModel, IdentityUserModel } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel, IdentityUserModel, NoopAuthModule, CoreModule } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PeopleCloudWidgetComponent } from './people-cloud.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { IdentityUserService } from '../../../../people/services/identity-user.service';
|
||||
import { mockShepherdsPie, mockYorkshirePudding } from '../../../../people/mock/people-cloud.mock';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
@@ -34,7 +33,7 @@ describe('PeopleCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, PeopleCloudWidgetComponent]
|
||||
imports: [CoreModule.forRoot(), NoopAuthModule, PeopleCloudWidgetComponent]
|
||||
});
|
||||
identityUserService = TestBed.inject(IdentityUserService);
|
||||
fixture = TestBed.createComponent(PeopleCloudWidgetComponent);
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PropertiesViewerWrapperComponent } from './properties-viewer-wrapper.component';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../../testing/process-service-cloud.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeNodeWithProperties } from '../../../../mocks/attach-file-cloud-widget.mock';
|
||||
import { NodesApiService, BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
import { NoopAuthModule, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('PropertiesViewerWidgetComponent', () => {
|
||||
let component: PropertiesViewerWrapperComponent;
|
||||
@@ -29,7 +29,7 @@ describe('PropertiesViewerWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, PropertiesViewerWrapperComponent],
|
||||
imports: [NoopTranslateModule, NoopAuthModule, PropertiesViewerWrapperComponent],
|
||||
providers: [NodesApiService, { provide: BasicPropertiesService, useValue: { getProperties: () => [] } }]
|
||||
});
|
||||
fixture = TestBed.createComponent(PropertiesViewerWrapperComponent);
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||
import { FormFieldModel, FormModel, NoopTranslateModule, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { PropertiesViewerWidgetComponent } from './properties-viewer.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { fakeNodeWithProperties } from '../../../mocks/attach-file-cloud-widget.mock';
|
||||
import { NodesApiService, BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
import { of } from 'rxjs';
|
||||
@@ -46,7 +45,7 @@ describe('PropertiesViewerWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, PropertiesViewerWidgetComponent],
|
||||
imports: [NoopTranslateModule, NoopAuthModule, PropertiesViewerWidgetComponent],
|
||||
providers: [NodesApiService, { provide: BasicPropertiesService, useValue: { getProperties: () => [] } }]
|
||||
});
|
||||
fixture = TestBed.createComponent(PropertiesViewerWidgetComponent);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormFieldModel, FormFieldOption, FormFieldTypes, FormModel } from '@alfresco/adf-core';
|
||||
import { FormCloudService } from '../../../services/form-cloud.service';
|
||||
import { RadioButtonsCloudWidgetComponent } from './radio-buttons-cloud.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -46,7 +45,7 @@ describe('RadioButtonsCloudWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, RadioButtonsCloudWidgetComponent]
|
||||
imports: [RadioButtonsCloudWidgetComponent]
|
||||
});
|
||||
formCloudService = TestBed.inject(FormCloudService);
|
||||
formUtilsService = TestBed.inject(FormUtilsService);
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { NotificationService, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { ContentCloudNodeSelectorService } from './content-cloud-node-selector.service';
|
||||
@@ -51,7 +50,7 @@ describe('ContentCloudNodeSelectorService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, MatDialogModule],
|
||||
imports: [NoopTranslateModule, MatDialogModule],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
});
|
||||
service = TestBed.inject(ContentCloudNodeSelectorService);
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, FormCloudService } from './form-cloud.service';
|
||||
import { of } from 'rxjs';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { FORM_FIELD_VALIDATORS, FormFieldValidator } from '@alfresco/adf-core';
|
||||
import { FORM_FIELD_VALIDATORS, FormFieldValidator, NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const mockTaskResponseBody = {
|
||||
entry: { id: 'id', name: 'name', formKey: 'form-key' }
|
||||
@@ -44,7 +43,7 @@ describe('Form Cloud service', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule],
|
||||
imports: [NoopAuthModule],
|
||||
providers: [{ provide: FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, useValue: [fakeValidator] }]
|
||||
});
|
||||
service = TestBed.inject(FormCloudService);
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { FormDefinitionSelectorCloudService } from './form-definition-selector-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { mockFormRepresentations } from '../mocks/form-representation.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('Form Definition Selector Cloud Service', () => {
|
||||
let service: FormDefinitionSelectorCloudService;
|
||||
@@ -28,7 +28,7 @@ describe('Form Definition Selector Cloud Service', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [NoopTranslateModule]
|
||||
});
|
||||
service = TestBed.inject(FormDefinitionSelectorCloudService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { GroupCloudComponent } from './group-cloud.component';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { IdentityGroupService } from '../services/identity-group.service';
|
||||
import { mockFoodGroups, mockMeatChicken, mockVegetableAubergine } from '../mock/group-cloud.mock';
|
||||
@@ -71,7 +70,7 @@ describe('GroupCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, GroupCloudComponent]
|
||||
imports: [GroupCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(GroupCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
import { PeopleCloudComponent } from './people-cloud.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
@@ -28,7 +27,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||
import { IdentityUserService } from '@alfresco/adf-process-services-cloud';
|
||||
import { IdentityUserService } from '../services/identity-user.service';
|
||||
|
||||
describe('PeopleCloudComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -81,7 +80,7 @@ describe('PeopleCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ProcessServiceCloudTestingModule, PeopleCloudComponent]
|
||||
imports: [NoopAuthModule, PeopleCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(PeopleCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { IdentityUserService } from './identity-user.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { mockFoodUsers } from '../mock/people-cloud.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { NoopTranslateModule, NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const mockHttpErrorResponse = new HttpErrorResponse({
|
||||
error: 'Mock Error',
|
||||
@@ -35,7 +35,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [NoopTranslateModule, NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(IdentityUserService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
|
||||
@@ -16,24 +16,18 @@
|
||||
*/
|
||||
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { FormRenderingService, provideTranslations } from '@alfresco/adf-core';
|
||||
import { provideTranslations } from '@alfresco/adf-core';
|
||||
import { APP_LIST_CLOUD_DIRECTIVES } from './app/app-list-cloud.module';
|
||||
import { TaskCloudModule } from './task/task-cloud.module';
|
||||
import { ProcessCloudModule } from './process/process-cloud.module';
|
||||
import { FORM_CLOUD_DIRECTIVES } from './form/form-cloud.module';
|
||||
import { TASK_FORM_CLOUD_DIRECTIVES } from './task/task-form/task-form.module';
|
||||
import {
|
||||
LocalPreferenceCloudService,
|
||||
PreferenceCloudServiceInterface,
|
||||
PROCESS_FILTERS_SERVICE_TOKEN,
|
||||
TASK_FILTERS_SERVICE_TOKEN,
|
||||
PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN,
|
||||
TASK_LIST_PREFERENCES_SERVICE_TOKEN
|
||||
} from './services/public-api';
|
||||
import { CloudFormRenderingService } from './form/components/cloud-form-rendering.service';
|
||||
import { PreferenceCloudServiceInterface, TASK_LIST_CLOUD_TOKEN } from './services/public-api';
|
||||
import { RichTextEditorComponent } from './rich-text-editor';
|
||||
import { GroupCloudComponent } from './group/components/group-cloud.component';
|
||||
import { PeopleCloudComponent } from './people/components/people-cloud.component';
|
||||
import { provideCloudFormRenderer, provideCloudPreferences } from './providers';
|
||||
import { TaskListCloudService } from './task/task-list/services/task-list-cloud.service';
|
||||
|
||||
export const PROCESS_SERVICES_CLOUD_DIRECTIVES = [
|
||||
...APP_LIST_CLOUD_DIRECTIVES,
|
||||
@@ -43,9 +37,20 @@ export const PROCESS_SERVICES_CLOUD_DIRECTIVES = [
|
||||
RichTextEditorComponent
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* @deprecated this module is deprecated and will be removed in the future versions
|
||||
*
|
||||
* Instead, import the standalone components directly, or use the following provider API to replicate the behaviour:
|
||||
*
|
||||
* providers: [
|
||||
* provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud')
|
||||
* provideCloudPreferences()
|
||||
* provideCloudFormRenderer(),
|
||||
* { provide: TASK_LIST_CLOUD_TOKEN, useClass: TaskListCloudService }
|
||||
* ]
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [ProcessCloudModule, TaskCloudModule, GroupCloudComponent, ...PROCESS_SERVICES_CLOUD_DIRECTIVES],
|
||||
providers: [provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud')],
|
||||
exports: [ProcessCloudModule, TaskCloudModule, GroupCloudComponent, ...PROCESS_SERVICES_CLOUD_DIRECTIVES]
|
||||
})
|
||||
export class ProcessServicesCloudModule {
|
||||
@@ -57,12 +62,12 @@ export class ProcessServicesCloudModule {
|
||||
ngModule: ProcessServicesCloudModule,
|
||||
providers: [
|
||||
provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud'),
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useExisting: filterPreferenceServiceInstance ?? LocalPreferenceCloudService },
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useExisting: filterPreferenceServiceInstance ?? LocalPreferenceCloudService },
|
||||
{ provide: PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, useExisting: listPreferenceServiceInstance ?? LocalPreferenceCloudService },
|
||||
{ provide: TASK_LIST_PREFERENCES_SERVICE_TOKEN, useExisting: listPreferenceServiceInstance ?? LocalPreferenceCloudService },
|
||||
FormRenderingService,
|
||||
{ provide: FormRenderingService, useClass: CloudFormRenderingService }
|
||||
provideCloudPreferences({
|
||||
filterPreferenceServiceInstance,
|
||||
listPreferenceServiceInstance
|
||||
}),
|
||||
provideCloudFormRenderer(),
|
||||
{ provide: TASK_LIST_CLOUD_TOKEN, useClass: TaskListCloudService }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { ADF_DATE_FORMATS, NoopAuthModule, NoopTranslateModule, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ADF_DATE_FORMATS, NoopAuthModule, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
@@ -28,7 +28,6 @@ import { MatExpansionPanelHarness } from '@angular/material/expansion/testing';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { endOfDay, format, isValid, startOfDay, subYears } from 'date-fns';
|
||||
import { enUS } from 'date-fns/locale';
|
||||
import { of } from 'rxjs';
|
||||
@@ -51,7 +50,7 @@ import {
|
||||
PROCESS_FILTER_ACTION_SAVE_DEFAULT
|
||||
} from './edit-process-filter-cloud.component';
|
||||
import { ProcessFilterDialogCloudComponent } from '../process-filter-dialog/process-filter-dialog-cloud.component';
|
||||
import { IdentityUserService } from '@alfresco/adf-process-services-cloud';
|
||||
import { IdentityUserService } from '../../../../people/services/identity-user.service';
|
||||
|
||||
describe('EditProcessFilterCloudComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -90,14 +89,7 @@ describe('EditProcessFilterCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NoopAuthModule,
|
||||
MatIconTestingModule,
|
||||
MatDialogModule,
|
||||
NoopTranslateModule,
|
||||
NoopAnimationsModule,
|
||||
EditProcessFilterCloudComponent
|
||||
],
|
||||
imports: [NoopAuthModule, MatIconTestingModule, MatDialogModule, EditProcessFilterCloudComponent],
|
||||
providers: [
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
{ provide: MAT_DATE_LOCALE, useValue: enUS },
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ProcessFilterDialogCloudComponent } from './process-filter-dialog-cloud.component';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ProcessFilterDialogCloudComponent', () => {
|
||||
let component: ProcessFilterDialogCloudComponent;
|
||||
@@ -35,7 +35,7 @@ describe('ProcessFilterDialogCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, ProcessFilterDialogCloudComponent],
|
||||
imports: [NoopTranslateModule, ProcessFilterDialogCloudComponent],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: mockDialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: mockDialogData }
|
||||
|
||||
@@ -24,9 +24,8 @@ import { By } from '@angular/platform-browser';
|
||||
import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../../services/cloud-token.service';
|
||||
import { LocalPreferenceCloudService } from '../../../../services/local-preference-cloud.service';
|
||||
import { mockProcessFilters } from '../../mock/process-filters-cloud.mock';
|
||||
import { AppConfigService, AppConfigServiceMock, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core';
|
||||
import { ProcessListCloudService } from '../../../process-list/services/process-list-cloud.service';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ApolloTestingModule } from 'apollo-angular/testing';
|
||||
|
||||
const ProcessFilterCloudServiceMock = {
|
||||
@@ -44,7 +43,7 @@ describe('ProcessFiltersCloudComponent', () => {
|
||||
|
||||
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopTranslateModule, NoopAnimationsModule, ProcessFiltersCloudComponent, ApolloTestingModule],
|
||||
imports: [ProcessFiltersCloudComponent, ApolloTestingModule],
|
||||
providers: [
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
|
||||
@@ -20,7 +20,6 @@ import { firstValueFrom, of } from 'rxjs';
|
||||
import { ProcessFilterCloudService } from './process-filter-cloud.service';
|
||||
import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import {
|
||||
fakeEmptyProcessCloudFilterEntries,
|
||||
fakeProcessCloudFilterEntries,
|
||||
@@ -33,6 +32,7 @@ import { ProcessFilterCloudModel } from '../models/process-filter-cloud.model';
|
||||
import { IdentityUserService } from '../../../people/services/identity-user.service';
|
||||
import { NotificationCloudService } from '../../../services/notification-cloud.service';
|
||||
import { ApolloTestingModule } from 'apollo-angular/testing';
|
||||
import { NoopTranslateModule, NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ProcessFilterCloudService', () => {
|
||||
let service: ProcessFilterCloudService;
|
||||
@@ -52,7 +52,7 @@ describe('ProcessFilterCloudService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, ApolloTestingModule],
|
||||
imports: [NoopTranslateModule, NoopAuthModule, ApolloTestingModule],
|
||||
providers: [{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }]
|
||||
});
|
||||
service = TestBed.inject(ProcessFilterCloudService);
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { AppConfigService, NoopAuthModule, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { ProcessHeaderCloudComponent } from './process-header-cloud.component';
|
||||
import { ProcessCloudService } from '../../services/process-cloud.service';
|
||||
import { processInstanceDetailsCloudMock } from '../../mock/process-instance-details-cloud.mock';
|
||||
@@ -32,7 +31,7 @@ describe('ProcessHeaderCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, ProcessHeaderCloudComponent]
|
||||
imports: [NoopTranslateModule, NoopAuthModule, ProcessHeaderCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(ProcessHeaderCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -29,22 +29,23 @@ import {
|
||||
getDataColumnMock,
|
||||
ObjectDataColumn,
|
||||
ObjectDataRow,
|
||||
User
|
||||
User,
|
||||
NoopAuthModule,
|
||||
NoopTranslateModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { ProcessListCloudService } from '../services/process-list-cloud.service';
|
||||
import { ProcessListCloudComponent } from './process-list-cloud.component';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { shareReplay, skip } from 'rxjs/operators';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { ProcessListCloudSortingModel } from '../models/process-list-sorting.model';
|
||||
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
||||
import { PROCESS_LIST_CUSTOM_VARIABLE_COLUMN, ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { provideCloudPreferences } from '../../../providers';
|
||||
|
||||
const fakeCustomSchema = [
|
||||
new ObjectDataColumn<ProcessListDataColumnCustomData>({
|
||||
@@ -218,7 +219,8 @@ describe('ProcessListCloudComponent', () => {
|
||||
|
||||
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, ProcessListCloudComponent]
|
||||
imports: [NoopAuthModule, ProcessListCloudComponent],
|
||||
providers: [provideCloudPreferences()]
|
||||
});
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
processListCloudService = TestBed.inject(ProcessListCloudService);
|
||||
@@ -1105,7 +1107,8 @@ describe('ProcessListCloudComponent: Injecting custom columns for task list - Cu
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, CustomTaskListComponent]
|
||||
imports: [CustomTaskListComponent],
|
||||
providers: [provideCloudPreferences()]
|
||||
});
|
||||
fixtureCustom = TestBed.createComponent(CustomTaskListComponent);
|
||||
fixtureCustom.detectChanges();
|
||||
@@ -1150,13 +1153,7 @@ describe('ProcessListCloudComponent: Creating an empty custom template - EmptyTe
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
ProcessServiceCloudTestingModule,
|
||||
MatProgressSpinnerModule,
|
||||
CustomEmptyContentTemplateDirective,
|
||||
ProcessListCloudComponent,
|
||||
EmptyTemplateComponent
|
||||
],
|
||||
imports: [NoopTranslateModule, CustomEmptyContentTemplateDirective, ProcessListCloudComponent, EmptyTemplateComponent],
|
||||
providers: [{ provide: PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, useValue: preferencesService }]
|
||||
});
|
||||
fixtureEmpty = TestBed.createComponent(EmptyTemplateComponent);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { ProcessListCloudService } from './process-list-cloud.service';
|
||||
import { ProcessListRequestModel, ProcessQueryCloudRequestModel } from '../models/process-cloud-query-request.model';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { catchError, firstValueFrom, of } from 'rxjs';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ProcessListCloudService', () => {
|
||||
let service: ProcessListCloudService;
|
||||
@@ -37,7 +37,7 @@ describe('ProcessListCloudService', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule]
|
||||
imports: [NoopTranslateModule]
|
||||
});
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
service = TestBed.inject(ProcessListCloudService);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user