mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Pre-Angular 9 upgrade fixes (#5712)
* remove deprecated angular/http * upgrade adf libs * fix production builds * ivy-compatible translate module usage * improved module usage * upgrade content services module * fix process services tests * upgrade process cloud tests * lint fixes * update core max size * fix insights test module * remove insights lazy loading workaround * fix insights module exports * * Fixed skipped form-cloud unit test and removed duplicated tests * cleanup the use of services Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
This commit is contained in:
@@ -19,8 +19,8 @@ import { ChangeDetectorRef, Component, ElementRef, SimpleChange } from '@angular
|
||||
import { ContentService } from './../services/content.service';
|
||||
import { CheckAllowableOperationDirective, NodeAllowableOperationSubject } from './check-allowable-operation.directive';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-text-subject',
|
||||
@@ -35,7 +35,9 @@ describe('CheckAllowableOperationDirective', () => {
|
||||
let changeDetectorMock: ChangeDetectorRef;
|
||||
|
||||
setupTestBed({
|
||||
imports: [CoreModule.forRoot()]
|
||||
imports: [
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -21,7 +21,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { HighlightTransformService } from '../services/highlight-transform.service';
|
||||
import { HighlightDirective } from './highlight.directive';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
/* spellchecker: disable */
|
||||
const template: string = `
|
||||
@@ -47,7 +47,7 @@ describe('HighlightDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
|
@@ -18,12 +18,11 @@
|
||||
import { Component, ContentChildren } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { AuthenticationService } from '../services';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { LogoutDirective } from './logout.directive';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
describe('LogoutDirective', () => {
|
||||
|
||||
@@ -44,8 +43,7 @@ describe('LogoutDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
RouterTestingModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
@@ -99,8 +97,7 @@ describe('LogoutDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
RouterTestingModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
@@ -143,8 +140,7 @@ describe('LogoutDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
RouterTestingModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
|
@@ -21,10 +21,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { NodeDeleteDirective } from './node-delete.directive';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { TranslationMock } from '../mock/translation.service.mock';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -83,10 +80,8 @@ describe('NodeDeleteDirective', () => {
|
||||
let fixtureWithPermissions: ComponentFixture<TestWithPermissionsComponent>;
|
||||
let fixtureWithPermanentComponent: ComponentFixture<TestDeletePermanentComponent>;
|
||||
let element: DebugElement;
|
||||
let elementWithPermissions: DebugElement;
|
||||
let elementWithPermanentDelete: DebugElement;
|
||||
let component: TestComponent;
|
||||
let componentWithPermissions: TestWithPermissionsComponent;
|
||||
let componentWithPermanentDelete: TestDeletePermanentComponent;
|
||||
let alfrescoApi: AlfrescoApiService;
|
||||
let nodeApi;
|
||||
@@ -96,16 +91,12 @@ describe('NodeDeleteDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
TestWithPermissionsComponent,
|
||||
TestDeletePermanentComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
]
|
||||
});
|
||||
|
||||
@@ -120,11 +111,9 @@ describe('NodeDeleteDirective', () => {
|
||||
fixtureWithPermanentComponent = TestBed.createComponent(TestDeletePermanentComponent);
|
||||
|
||||
component = fixture.componentInstance;
|
||||
componentWithPermissions = fixtureWithPermissions.componentInstance;
|
||||
componentWithPermanentDelete = fixtureWithPermanentComponent.componentInstance;
|
||||
|
||||
element = fixture.debugElement.query(By.directive(NodeDeleteDirective));
|
||||
elementWithPermissions = fixtureWithPermissions.debugElement.query(By.directive(NodeDeleteDirective));
|
||||
elementWithPermanentDelete = fixtureWithPermanentComponent.debugElement.query(By.directive(NodeDeleteDirective));
|
||||
});
|
||||
|
||||
@@ -330,6 +319,9 @@ describe('NodeDeleteDirective', () => {
|
||||
});
|
||||
|
||||
it('should not enable the button if adf-check-allowable-operation is present', (done) => {
|
||||
const elementWithPermissions = fixtureWithPermissions.debugElement.query(By.directive(NodeDeleteDirective));
|
||||
const componentWithPermissions = fixtureWithPermissions.componentInstance;
|
||||
|
||||
elementWithPermissions.nativeElement.disabled = false;
|
||||
componentWithPermissions.selection = [];
|
||||
|
||||
|
@@ -20,11 +20,11 @@ import { By } from '@angular/platform-browser';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { Component, DebugElement } from '@angular/core';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { DialogModule } from '../dialogs/dialog.module';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
@Component({
|
||||
template: '<div [adfNodeDownload]="selection"></div>'
|
||||
@@ -44,7 +44,7 @@ describe('NodeDownloadDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
DialogModule
|
||||
],
|
||||
providers: [
|
||||
|
@@ -21,10 +21,9 @@ import { By } from '@angular/platform-browser';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { NodeRestoreDirective } from './node-restore.directive';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -51,8 +50,7 @@ describe('NodeRestoreDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
NoopAnimationsModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
|
Reference in New Issue
Block a user