mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-36260 global test setup (#10970)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
import { FileViewerWidgetComponent } from './file-viewer.widget';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormModel, FormService, FormFieldModel, RedirectAuthService, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { FormModel, FormService, FormFieldModel, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('FileViewerWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopTranslateModule, FileViewerWidgetComponent],
|
||||
imports: [FileViewerWidgetComponent],
|
||||
providers: [
|
||||
{ provide: FormService, useValue: formServiceStub },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
|
@@ -25,8 +25,7 @@ import {
|
||||
FormFieldModel,
|
||||
FormModel,
|
||||
AppConfigServiceMock,
|
||||
AppConfigService,
|
||||
NoopTranslateModule
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { RadioButtonsWidgetComponent } from './radio-buttons.widget';
|
||||
import { TaskFormService } from '../../services/task-form.service';
|
||||
@@ -44,7 +43,7 @@ describe('RadioButtonsWidgetComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
getTestBed().configureTestingModule({
|
||||
imports: [NoopTranslateModule, RadioButtonsWidgetComponent],
|
||||
imports: [RadioButtonsWidgetComponent],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, getTestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, AppConfigServiceMock, FormRenderingService, LocalizedDatePipe, NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, AppConfigServiceMock, FormRenderingService, LocalizedDatePipe } from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { ProcessService } from '../../services/process.service';
|
||||
@@ -34,7 +34,6 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatAutocompleteHarness } from '@angular/material/autocomplete/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RestVariable } from '@alfresco/js-api';
|
||||
import { ActivitiContentService } from '../../../form/services/activiti-alfresco.service';
|
||||
import { AppsProcessService } from '../../../services/apps-process.service';
|
||||
@@ -57,7 +56,7 @@ describe('StartProcessComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
getTestBed().configureTestingModule({
|
||||
imports: [NoopTranslateModule, NoopAnimationsModule, StartProcessInstanceComponent],
|
||||
imports: [StartProcessInstanceComponent],
|
||||
providers: [
|
||||
LocalizedDatePipe,
|
||||
{ provide: FormRenderingService, useClass: ProcessFormRenderingService },
|
||||
|
@@ -28,7 +28,6 @@ import {
|
||||
DataColumnComponent,
|
||||
DataColumnListComponent,
|
||||
FullNamePipe,
|
||||
NoopTranslateModule,
|
||||
CustomEmptyContentTemplateDirective
|
||||
} from '@alfresco/adf-core';
|
||||
import { TaskListService } from '../../services/tasklist.service';
|
||||
@@ -41,7 +40,6 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@@ -108,7 +106,7 @@ describe('TaskListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopTranslateModule, NoopAnimationsModule, TaskListComponent],
|
||||
imports: [TaskListComponent],
|
||||
providers: [
|
||||
TaskListService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
|
@@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* @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 { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
@NgModule({
|
||||
imports: [BrowserDynamicTestingModule, NoopTranslateModule, NoopAnimationsModule]
|
||||
})
|
||||
export class GlobalTestingModule {}
|
@@ -17,10 +17,10 @@
|
||||
|
||||
import 'zone.js';
|
||||
import 'zone.js/testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||
import { GlobalTestingModule } from './lib/testing/global-testing.module';
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||
TestBed.initTestEnvironment(GlobalTestingModule, platformBrowserDynamicTesting(), {
|
||||
teardown: { destroyAfterEach: true }
|
||||
});
|
||||
|
Reference in New Issue
Block a user