[ADF-5426] Remove compatibility layer from Lib (#7110)

* remove compatibility step 1

* remove compatibility step 2

* remove compatibility step 3

* remove compatibility step 4

* remove compatibility step 5
This commit is contained in:
Eugenio Romano
2021-08-04 17:31:35 +02:00
committed by GitHub
parent 5d5b582e32
commit f30b20cc46
113 changed files with 1375 additions and 2348 deletions

View File

@@ -18,7 +18,6 @@
import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
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 { TranslationService } from '../services/translation.service';
@@ -41,9 +40,7 @@ describe('NodeRestoreDirective', () => {
let fixture: ComponentFixture<TestComponent>;
let element: DebugElement;
let component: TestComponent;
let alfrescoService: AlfrescoApiService;
let nodesService;
let coreApi;
let trashcanApi;
let directiveInstance;
let restoreNodeSpy: any;
let translationService: TranslationService;
@@ -64,12 +61,10 @@ describe('NodeRestoreDirective', () => {
element = fixture.debugElement.query(By.directive(NodeRestoreDirective));
directiveInstance = element.injector.get(NodeRestoreDirective);
alfrescoService = TestBed.inject(AlfrescoApiService);
nodesService = alfrescoService.getInstance().nodes;
coreApi = alfrescoService.getInstance().core;
trashcanApi = directiveInstance['trashcanApi'];
restoreNodeSpy = spyOn(nodesService, 'restoreNode').and.returnValue(Promise.resolve());
spyOn(coreApi.nodesApi, 'getDeletedNodes').and.returnValue(Promise.resolve({
restoreNodeSpy = spyOn(trashcanApi, 'restoreDeletedNode').and.returnValue(Promise.resolve());
spyOn(trashcanApi, 'listDeletedNodes').and.returnValue(Promise.resolve({
list: { entries: [] }
}));
@@ -83,7 +78,7 @@ describe('NodeRestoreDirective', () => {
fixture.detectChanges();
element.triggerEventHandler('click', null);
expect(nodesService.restoreNode).not.toHaveBeenCalled();
expect(trashcanApi.restoreDeletedNode).not.toHaveBeenCalled();
});
it('should not restore nodes when selection has nodes without path', (done) => {
@@ -93,7 +88,7 @@ describe('NodeRestoreDirective', () => {
fixture.whenStable().then(() => {
element.triggerEventHandler('click', null);
expect(nodesService.restoreNode).not.toHaveBeenCalled();
expect(trashcanApi.restoreDeletedNode).not.toHaveBeenCalled();
done();
});
});
@@ -104,7 +99,7 @@ describe('NodeRestoreDirective', () => {
fixture.detectChanges();
element.triggerEventHandler('click', null);
fixture.whenStable().then(() => {
expect(nodesService.restoreNode).toHaveBeenCalled();
expect(trashcanApi.restoreDeletedNode).toHaveBeenCalled();
done();
});
});