mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +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:
@@ -18,10 +18,9 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, tick, fakeAsync } from '@angular/core/testing';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
import { ClipboardDirective } from './clipboard.directive';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-test-component',
|
||||
@@ -43,7 +42,7 @@ describe('ClipboardDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestTargetClipboardComponent
|
||||
@@ -85,8 +84,7 @@ describe('CopyClipboardDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
RouterTestingModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestCopyClipboardComponent
|
||||
@@ -109,9 +107,11 @@ describe('CopyClipboardDirective', () => {
|
||||
it('should not show tooltip when element it is not hovered', (() => {
|
||||
const spanHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('span');
|
||||
spanHTMLElement.dispatchEvent(new Event('mouseenter'));
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement.querySelector('.adf-copy-tooltip')).not.toBeNull();
|
||||
|
||||
spanHTMLElement.dispatchEvent(new Event('mouseleave'));
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement.querySelector('.adf-copy-tooltip')).toBeNull();
|
||||
}));
|
||||
|
||||
|
@@ -23,7 +23,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule.forChild()
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [
|
||||
ClipboardDirective,
|
||||
|
@@ -16,16 +16,11 @@
|
||||
*/
|
||||
|
||||
import { NotificationService } from '../notifications/services/notification.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ClipboardModule } from './clipboard.module';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { MatSnackBarModule } from '@angular/material';
|
||||
import { TranslationMock } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '../testing/setup-test-bed';
|
||||
import { CoreTestingModule } from '../testing';
|
||||
|
||||
describe('ClipboardService', () => {
|
||||
let clipboardService: ClipboardService;
|
||||
@@ -34,13 +29,8 @@ describe('ClipboardService', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
ClipboardModule,
|
||||
HttpClientModule,
|
||||
CoreTestingModule,
|
||||
MatSnackBarModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
]
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user