mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
stabilize the node selector tests (#1616)
* stabilize spy objects * cleanup unit tests * remove fdescribe
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import { TestBed, async } from '@angular/core/testing';
|
import { TestBed, async } from '@angular/core/testing';
|
||||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { of, throwError, Subject } from 'rxjs';
|
import { of, throwError, Subject, Observable } from 'rxjs';
|
||||||
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
||||||
import { DocumentListService } from '@alfresco/adf-content-services';
|
import { DocumentListService } from '@alfresco/adf-content-services';
|
||||||
import { NodeActionsService, BatchOperationType } from './node-actions.service';
|
import { NodeActionsService, BatchOperationType } from './node-actions.service';
|
||||||
@@ -34,7 +34,7 @@ import { AppTestingModule } from '../testing/app-testing.module';
|
|||||||
import { ContentApiService } from '@alfresco/aca-shared';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
class TestNode {
|
class TestNode {
|
||||||
entry?: MinimalNodeEntryEntity;
|
entry: MinimalNodeEntryEntity;
|
||||||
|
|
||||||
constructor(id?: string, isFile?: boolean, name?: string, permission?: string[], nodeType?: string, properties?: any) {
|
constructor(id?: string, isFile?: boolean, name?: string, permission?: string[], nodeType?: string, properties?: any) {
|
||||||
this.entry = {} as any;
|
this.entry = {} as any;
|
||||||
@@ -64,8 +64,8 @@ describe('NodeActionsService', () => {
|
|||||||
let service: NodeActionsService;
|
let service: NodeActionsService;
|
||||||
let apiService: AlfrescoApiService;
|
let apiService: AlfrescoApiService;
|
||||||
let nodesApi;
|
let nodesApi;
|
||||||
const spyOnSuccess = jasmine.createSpy('spyOnSuccess');
|
let spyOnSuccess: jasmine.Spy;
|
||||||
const spyOnError = jasmine.createSpy('spyOnError');
|
let spyOnError: jasmine.Spy;
|
||||||
let contentApi: ContentApiService;
|
let contentApi: ContentApiService;
|
||||||
let dialog: MatDialog;
|
let dialog: MatDialog;
|
||||||
|
|
||||||
@@ -102,6 +102,9 @@ describe('NodeActionsService', () => {
|
|||||||
imports: [AppTestingModule]
|
imports: [AppTestingModule]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
spyOnSuccess = jasmine.createSpy('spyOnSuccess');
|
||||||
|
spyOnError = jasmine.createSpy('spyOnError');
|
||||||
|
|
||||||
contentApi = TestBed.inject(ContentApiService);
|
contentApi = TestBed.inject(ContentApiService);
|
||||||
|
|
||||||
service = TestBed.inject(NodeActionsService);
|
service = TestBed.inject(NodeActionsService);
|
||||||
@@ -193,11 +196,6 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('doBatchOperation', () => {
|
describe('doBatchOperation', () => {
|
||||||
beforeEach(() => {
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should throw error if 'contentEntities' required parameter is missing", async(() => {
|
it("should throw error if 'contentEntities' required parameter is missing", async(() => {
|
||||||
const contentEntities = undefined;
|
const contentEntities = undefined;
|
||||||
const doCopyBatchOperation = service.copyNodes(contentEntities).asObservable();
|
const doCopyBatchOperation = service.copyNodes(contentEntities).asObservable();
|
||||||
@@ -205,12 +203,8 @@ describe('NodeActionsService', () => {
|
|||||||
doCopyBatchOperation
|
doCopyBatchOperation
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).not.toHaveBeenCalled();
|
expect(spyOnSuccess).not.toHaveBeenCalled();
|
||||||
@@ -225,12 +219,8 @@ describe('NodeActionsService', () => {
|
|||||||
doCopyBatchOperation
|
doCopyBatchOperation
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).not.toHaveBeenCalled();
|
expect(spyOnSuccess).not.toHaveBeenCalled();
|
||||||
@@ -245,12 +235,8 @@ describe('NodeActionsService', () => {
|
|||||||
doCopyBatchOperation
|
doCopyBatchOperation
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).not.toHaveBeenCalled();
|
expect(spyOnSuccess).not.toHaveBeenCalled();
|
||||||
@@ -293,9 +279,9 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('rowFilter', () => {
|
describe('rowFilter', () => {
|
||||||
let fileToCopy;
|
let fileToCopy: TestNode;
|
||||||
let folderToCopy;
|
let folderToCopy: TestNode;
|
||||||
let testContentNodeSelectorComponentData;
|
let dialogData: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fileToCopy = new TestNode(fileId, isFile, 'file-name');
|
fileToCopy = new TestNode(fileId, isFile, 'file-name');
|
||||||
@@ -304,7 +290,7 @@ describe('NodeActionsService', () => {
|
|||||||
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
||||||
|
|
||||||
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
||||||
testContentNodeSelectorComponentData = data;
|
dialogData = data;
|
||||||
return { componentInstance: {} } as MatDialogRef<any>;
|
return { componentInstance: {} } as MatDialogRef<any>;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -313,13 +299,13 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
it('should filter destination nodes and not show files', () => {
|
it('should filter destination nodes and not show files', () => {
|
||||||
const file = new TestNode('a-file', isFile);
|
const file = new TestNode('a-file', isFile);
|
||||||
expect(testContentNodeSelectorComponentData.data.rowFilter({ node: file })).toBe(false);
|
expect(dialogData.data.rowFilter({ node: file })).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter destination nodes and not show the symlinks', () => {
|
it('should filter destination nodes and not show the symlinks', () => {
|
||||||
const symlinkDestinationFolder = new TestNode('symlink-id', !isFile, 'symlink-name', [], 'app:folderlink');
|
const symlinkDestinationFolder = new TestNode('symlink-id', !isFile, 'symlink-name', [], 'app:folderlink');
|
||||||
expect(
|
expect(
|
||||||
testContentNodeSelectorComponentData.data.rowFilter({
|
dialogData.data.rowFilter({
|
||||||
node: symlinkDestinationFolder
|
node: symlinkDestinationFolder
|
||||||
})
|
})
|
||||||
).toBe(false);
|
).toBe(false);
|
||||||
@@ -328,7 +314,7 @@ describe('NodeActionsService', () => {
|
|||||||
it('should filter destination nodes and show folders', () => {
|
it('should filter destination nodes and show folders', () => {
|
||||||
const destinationFolder = new TestNode(folderDestinationId);
|
const destinationFolder = new TestNode(folderDestinationId);
|
||||||
expect(
|
expect(
|
||||||
testContentNodeSelectorComponentData.data.rowFilter({
|
dialogData.data.rowFilter({
|
||||||
node: destinationFolder
|
node: destinationFolder
|
||||||
})
|
})
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
@@ -336,9 +322,9 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('copyNodes', () => {
|
describe('copyNodes', () => {
|
||||||
let fileToCopy;
|
let fileToCopy: TestNode;
|
||||||
let folderToCopy;
|
let folderToCopy: TestNode;
|
||||||
let destinationFolder;
|
let destinationFolder: TestNode;
|
||||||
let translationService: TranslationService;
|
let translationService: TranslationService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -370,9 +356,9 @@ describe('NodeActionsService', () => {
|
|||||||
const spyOnDestinationPicker = spyOn(service, 'getContentNodeSelection').and.callThrough();
|
const spyOnDestinationPicker = spyOn(service, 'getContentNodeSelection').and.callThrough();
|
||||||
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
||||||
|
|
||||||
let testContentNodeSelectorComponentData;
|
let dialogData: any;
|
||||||
const spyOnDialog = spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
const spyOnDialog = spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
||||||
testContentNodeSelectorComponentData = data;
|
dialogData = data;
|
||||||
return { componentInstance: {} } as MatDialogRef<any>;
|
return { componentInstance: {} } as MatDialogRef<any>;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -382,18 +368,18 @@ describe('NodeActionsService', () => {
|
|||||||
expect(spyOnDestinationPicker.calls.count()).toEqual(1);
|
expect(spyOnDestinationPicker.calls.count()).toEqual(1);
|
||||||
expect(spyOnDialog.calls.count()).toEqual(1);
|
expect(spyOnDialog.calls.count()).toEqual(1);
|
||||||
|
|
||||||
expect(testContentNodeSelectorComponentData).toBeDefined();
|
expect(dialogData).toBeDefined();
|
||||||
expect(
|
expect(
|
||||||
testContentNodeSelectorComponentData.data.rowFilter({
|
dialogData.data.rowFilter({
|
||||||
node: destinationFolder
|
node: destinationFolder
|
||||||
})
|
})
|
||||||
).toBeDefined();
|
).toBeDefined();
|
||||||
expect(
|
expect(
|
||||||
testContentNodeSelectorComponentData.data.imageResolver({
|
dialogData.data.imageResolver({
|
||||||
node: destinationFolder
|
node: destinationFolder
|
||||||
})
|
})
|
||||||
).toBeDefined();
|
).toBeDefined();
|
||||||
expect(testContentNodeSelectorComponentData.data.title).toBe('NODE_SELECTOR.COPY_ITEMS');
|
expect(dialogData.data.title).toBe('NODE_SELECTOR.COPY_ITEMS');
|
||||||
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEMS', {
|
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEMS', {
|
||||||
name: '',
|
name: '',
|
||||||
number: 2
|
number: 2
|
||||||
@@ -401,7 +387,7 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
destinationFolder.entry['allowableOperations'] = ['update'];
|
destinationFolder.entry['allowableOperations'] = ['update'];
|
||||||
expect(
|
expect(
|
||||||
testContentNodeSelectorComponentData.data.imageResolver({
|
dialogData.data.imageResolver({
|
||||||
node: destinationFolder
|
node: destinationFolder
|
||||||
})
|
})
|
||||||
).toBeDefined();
|
).toBeDefined();
|
||||||
@@ -412,17 +398,17 @@ describe('NodeActionsService', () => {
|
|||||||
spyOn(service, 'getContentNodeSelection').and.callThrough();
|
spyOn(service, 'getContentNodeSelection').and.callThrough();
|
||||||
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
||||||
|
|
||||||
let testContentNodeSelectorComponentData;
|
let dialogData: any;
|
||||||
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
||||||
testContentNodeSelectorComponentData = data;
|
dialogData = data;
|
||||||
return { componentInstance: {} } as MatDialogRef<any>;
|
return { componentInstance: {} } as MatDialogRef<any>;
|
||||||
});
|
});
|
||||||
|
|
||||||
service.copyNodes([{ entry: { id: 'entry-id', name: 'entry-name' } }]);
|
service.copyNodes([{ entry: { id: 'entry-id', name: 'entry-name' } }]);
|
||||||
|
|
||||||
expect(spyOnBatchOperation).toHaveBeenCalled();
|
expect(spyOnBatchOperation).toHaveBeenCalled();
|
||||||
expect(testContentNodeSelectorComponentData).toBeDefined();
|
expect(dialogData).toBeDefined();
|
||||||
expect(testContentNodeSelectorComponentData.data.title).toBe('NODE_SELECTOR.COPY_ITEM');
|
expect(dialogData.data.title).toBe('NODE_SELECTOR.COPY_ITEM');
|
||||||
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEM', {
|
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEM', {
|
||||||
name: 'entry-name',
|
name: 'entry-name',
|
||||||
number: 1
|
number: 1
|
||||||
@@ -434,17 +420,17 @@ describe('NodeActionsService', () => {
|
|||||||
spyOn(service, 'getContentNodeSelection').and.callThrough();
|
spyOn(service, 'getContentNodeSelection').and.callThrough();
|
||||||
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
spyOn(service, 'getEntryParentId').and.returnValue('parent-id');
|
||||||
|
|
||||||
let testContentNodeSelectorComponentData;
|
let dialogData: any;
|
||||||
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => {
|
||||||
testContentNodeSelectorComponentData = data;
|
dialogData = data;
|
||||||
return { componentInstance: {} } as MatDialogRef<any>;
|
return { componentInstance: {} } as MatDialogRef<any>;
|
||||||
});
|
});
|
||||||
|
|
||||||
service.copyNodes([{ entry: { id: 'entry-id' } }]);
|
service.copyNodes([{ entry: { id: 'entry-id' } }]);
|
||||||
|
|
||||||
expect(spyOnBatchOperation).toHaveBeenCalled();
|
expect(spyOnBatchOperation).toHaveBeenCalled();
|
||||||
expect(testContentNodeSelectorComponentData).toBeDefined();
|
expect(dialogData).toBeDefined();
|
||||||
expect(testContentNodeSelectorComponentData.data.title).toBe('NODE_SELECTOR.COPY_ITEMS');
|
expect(dialogData.data.title).toBe('NODE_SELECTOR.COPY_ITEMS');
|
||||||
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEMS', {
|
expect(translationService.instant).toHaveBeenCalledWith('NODE_SELECTOR.COPY_ITEMS', {
|
||||||
name: '',
|
name: '',
|
||||||
number: 1
|
number: 1
|
||||||
@@ -489,14 +475,10 @@ describe('NodeActionsService', () => {
|
|||||||
const spyFolderAction = spyOn(service, 'copyFolderAction').and.callThrough();
|
const spyFolderAction = spyOn(service, 'copyFolderAction').and.callThrough();
|
||||||
const copyObservable = service.copyNodeAction(folderToCopy.entry, folderDestination.entry.id);
|
const copyObservable = service.copyNodeAction(folderToCopy.entry, folderDestination.entry.id);
|
||||||
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => spyOnSuccess(response),
|
||||||
spyOnSuccess(response);
|
|
||||||
},
|
|
||||||
() => {
|
() => {
|
||||||
spyOnError();
|
spyOnError();
|
||||||
|
|
||||||
@@ -525,17 +507,11 @@ describe('NodeActionsService', () => {
|
|||||||
const folderDestination = new TestNode(folderDestinationId);
|
const folderDestination = new TestNode(folderDestinationId);
|
||||||
const copyObservable = service.copyNodeAction(fileToCopy.entry, folderDestination.entry.id);
|
const copyObservable = service.copyNodeAction(fileToCopy.entry, folderDestination.entry.id);
|
||||||
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => spyOnSuccess(response),
|
||||||
spyOnSuccess(response);
|
() => spyOnError()
|
||||||
},
|
|
||||||
() => {
|
|
||||||
spyOnError();
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
||||||
@@ -551,8 +527,7 @@ describe('NodeActionsService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should copy one file node to same destination and autoRename it', async(() => {
|
it('should copy one file node to same destination and autoRename it', async(() => {
|
||||||
const alreadyExistingName = 'file-name';
|
spyOn(nodesApi, 'copyNode').and.callFake(helper.fakeCopyNode(!actionIsForbidden, 'file-name'));
|
||||||
spyOn(nodesApi, 'copyNode').and.callFake(helper.fakeCopyNode(!actionIsForbidden, alreadyExistingName));
|
|
||||||
|
|
||||||
const spyContentAction = spyOn(service, 'copyContentAction').and.callThrough();
|
const spyContentAction = spyOn(service, 'copyContentAction').and.callThrough();
|
||||||
|
|
||||||
@@ -560,17 +535,11 @@ describe('NodeActionsService', () => {
|
|||||||
const folderDestination = new TestNode(folderDestinationId);
|
const folderDestination = new TestNode(folderDestinationId);
|
||||||
const copyObservable = service.copyNodeAction(fileToCopy.entry, folderDestination.entry.id);
|
const copyObservable = service.copyNodeAction(fileToCopy.entry, folderDestination.entry.id);
|
||||||
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
() => spyOnError()
|
||||||
},
|
|
||||||
() => {
|
|
||||||
spyOnError();
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).toHaveBeenCalled();
|
expect(spyOnSuccess).toHaveBeenCalled();
|
||||||
@@ -585,14 +554,14 @@ describe('NodeActionsService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
describe('should copy content of folder-to-copy to folder with same name from destination folder', () => {
|
describe('should copy content of folder-to-copy to folder with same name from destination folder', () => {
|
||||||
let folderToCopy;
|
let folderToCopy: TestNode;
|
||||||
let fileChildOfFolderToCopy;
|
let fileChildOfFolderToCopy: TestNode;
|
||||||
let folderParentAndDestination;
|
let folderParentAndDestination: TestNode;
|
||||||
let existingFolder;
|
let existingFolder: NodeChildAssociationEntry;
|
||||||
let spy;
|
let spy: jasmine.Spy;
|
||||||
let spyOnContentAction;
|
let spyOnContentAction: jasmine.Spy;
|
||||||
let spyOnFolderAction;
|
let spyOnFolderAction: jasmine.Spy;
|
||||||
let copyObservable;
|
let copyObservable: Observable<any>;
|
||||||
let subject: Subject<NodeChildAssociationEntry>;
|
let subject: Subject<NodeChildAssociationEntry>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -601,7 +570,7 @@ describe('NodeActionsService', () => {
|
|||||||
fileChildOfFolderToCopy = new TestNode(fileId, isFile, 'file-name');
|
fileChildOfFolderToCopy = new TestNode(fileId, isFile, 'file-name');
|
||||||
|
|
||||||
folderParentAndDestination = new TestNode(folderDestinationId);
|
folderParentAndDestination = new TestNode(folderDestinationId);
|
||||||
existingFolder = new TestNode('existing-folder-id', !isFile, 'conflicting-name');
|
existingFolder = new TestNode('existing-folder-id', !isFile, 'conflicting-name') as NodeChildAssociationEntry;
|
||||||
|
|
||||||
spy = spyOn(nodesApi, 'copyNode').and.callFake(helper.fakeCopyNode(!actionIsForbidden, 'conflicting-name'));
|
spy = spyOn(nodesApi, 'copyNode').and.callFake(helper.fakeCopyNode(!actionIsForbidden, 'conflicting-name'));
|
||||||
|
|
||||||
@@ -609,8 +578,6 @@ describe('NodeActionsService', () => {
|
|||||||
spyOnFolderAction = spyOn(service, 'copyFolderAction').and.callThrough();
|
spyOnFolderAction = spyOn(service, 'copyFolderAction').and.callThrough();
|
||||||
|
|
||||||
copyObservable = service.copyNodeAction(folderToCopy.entry, folderParentAndDestination.entry.id);
|
copyObservable = service.copyNodeAction(folderToCopy.entry, folderParentAndDestination.entry.id);
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => subject.complete());
|
afterEach(() => subject.complete());
|
||||||
@@ -632,12 +599,8 @@ describe('NodeActionsService', () => {
|
|||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
() => spyOnError()
|
||||||
},
|
|
||||||
() => {
|
|
||||||
spyOnError();
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).toHaveBeenCalled();
|
expect(spyOnSuccess).toHaveBeenCalled();
|
||||||
@@ -681,12 +644,8 @@ describe('NodeActionsService', () => {
|
|||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
() => spyOnError()
|
||||||
},
|
|
||||||
() => {
|
|
||||||
spyOnError();
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).toHaveBeenCalled();
|
expect(spyOnSuccess).toHaveBeenCalled();
|
||||||
@@ -726,12 +685,8 @@ describe('NodeActionsService', () => {
|
|||||||
copyObservable
|
copyObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
() => spyOnError()
|
||||||
},
|
|
||||||
() => {
|
|
||||||
spyOnError();
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnSuccess).toHaveBeenCalled();
|
expect(spyOnSuccess).toHaveBeenCalled();
|
||||||
@@ -762,12 +717,11 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
describe('moveNodes', () => {
|
describe('moveNodes', () => {
|
||||||
const permissionToMove = 'delete';
|
const permissionToMove = 'delete';
|
||||||
let fileToMove;
|
let fileToMove: TestNode;
|
||||||
let folderToMove;
|
let folderToMove: TestNode;
|
||||||
let destinationFolder;
|
let destinationFolder: TestNode;
|
||||||
let spyOnBatchOperation;
|
let spyOnBatchOperation: jasmine.Spy;
|
||||||
let spyOnDocumentListServiceAction;
|
let documentListService: DocumentListService;
|
||||||
let documentListService;
|
|
||||||
let subject: Subject<MinimalNodeEntryEntity[]>;
|
let subject: Subject<MinimalNodeEntryEntity[]>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -780,8 +734,6 @@ describe('NodeActionsService', () => {
|
|||||||
spyOnBatchOperation = spyOn(service, 'doBatchOperation').and.callThrough();
|
spyOnBatchOperation = spyOn(service, 'doBatchOperation').and.callThrough();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => subject.complete());
|
|
||||||
|
|
||||||
it('should allow to select destination for nodes that have permission to be moved', () => {
|
it('should allow to select destination for nodes that have permission to be moved', () => {
|
||||||
const spyOnDestinationPicker = spyOn(service, 'getContentNodeSelection').and.returnValue(subject);
|
const spyOnDestinationPicker = spyOn(service, 'getContentNodeSelection').and.returnValue(subject);
|
||||||
spyOn(service, 'moveContentAction').and.returnValue(of({}));
|
spyOn(service, 'moveContentAction').and.returnValue(of({}));
|
||||||
@@ -813,38 +765,29 @@ describe('NodeActionsService', () => {
|
|||||||
it('should call the documentListService moveNode directly for moving a file that has permission to be moved', () => {
|
it('should call the documentListService moveNode directly for moving a file that has permission to be moved', () => {
|
||||||
spyOn(service, 'getContentNodeSelection').and.returnValue(subject);
|
spyOn(service, 'getContentNodeSelection').and.returnValue(subject);
|
||||||
fileToMove.entry['allowableOperations'] = [permissionToMove];
|
fileToMove.entry['allowableOperations'] = [permissionToMove];
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(of([fileToMove]));
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.returnValue(of(fileToMove));
|
||||||
spyOn(service, 'moveNodeAction');
|
spyOn(service, 'moveNodeAction');
|
||||||
|
|
||||||
service.moveNodes([fileToMove], permissionToMove);
|
service.moveNodes([fileToMove], permissionToMove);
|
||||||
subject.next([destinationFolder.entry]);
|
subject.next([destinationFolder.entry]);
|
||||||
|
|
||||||
expect(service.moveNodeAction).not.toHaveBeenCalled();
|
expect(service.moveNodeAction).not.toHaveBeenCalled();
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('moveContentAction', () => {
|
describe('moveContentAction', () => {
|
||||||
beforeEach(() => {
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not throw error on conflict, to be able to show message in case of partial move of files', async(() => {
|
it('should not throw error on conflict, to be able to show message in case of partial move of files', async(() => {
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(throwError(conflictError));
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.returnValue(throwError(conflictError));
|
||||||
|
|
||||||
const moveContentActionObservable = service.moveContentAction(fileToMove.entry, folderDestinationId);
|
const moveContentActionObservable = service.moveContentAction(fileToMove.entry, folderDestinationId);
|
||||||
moveContentActionObservable
|
moveContentActionObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(value) => {
|
(value) => spyOnSuccess(value),
|
||||||
spyOnSuccess(value);
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(spyOnSuccess).toHaveBeenCalledWith(conflictError);
|
expect(spyOnSuccess).toHaveBeenCalledWith(conflictError);
|
||||||
expect(spyOnError).not.toHaveBeenCalledWith(conflictError);
|
expect(spyOnError).not.toHaveBeenCalledWith(conflictError);
|
||||||
@@ -852,21 +795,17 @@ describe('NodeActionsService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should not throw permission error, to be able to show message in case of partial move of files', async(() => {
|
it('should not throw permission error, to be able to show message in case of partial move of files', async(() => {
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(throwError(permissionError));
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.returnValue(throwError(permissionError));
|
||||||
|
|
||||||
const moveContentActionObservable = service.moveContentAction(fileToMove.entry, folderDestinationId);
|
const moveContentActionObservable = service.moveContentAction(fileToMove.entry, folderDestinationId);
|
||||||
moveContentActionObservable
|
moveContentActionObservable
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(value) => {
|
(value) => spyOnSuccess(value),
|
||||||
spyOnSuccess(value);
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
||||||
expect(spyOnError).not.toHaveBeenCalledWith(permissionError);
|
expect(spyOnError).not.toHaveBeenCalledWith(permissionError);
|
||||||
@@ -877,21 +816,17 @@ describe('NodeActionsService', () => {
|
|||||||
const parentID = 'parent-id';
|
const parentID = 'parent-id';
|
||||||
fileToMove.entry['parentId'] = parentID;
|
fileToMove.entry['parentId'] = parentID;
|
||||||
fileToMove.entry['allowableOperations'] = [permissionToMove];
|
fileToMove.entry['allowableOperations'] = [permissionToMove];
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(of(fileToMove));
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.returnValue(of(fileToMove));
|
||||||
|
|
||||||
const moveContentActionObservable = service.moveContentAction(fileToMove.entry, folderDestinationId);
|
service
|
||||||
moveContentActionObservable
|
.moveContentAction(fileToMove.entry, folderDestinationId)
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(value) => {
|
(value) => spyOnSuccess(value),
|
||||||
spyOnSuccess(value);
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(spyOnSuccess).toHaveBeenCalledWith({
|
expect(spyOnSuccess).toHaveBeenCalledWith({
|
||||||
itemMoved: fileToMove,
|
itemMoved: fileToMove,
|
||||||
@@ -903,31 +838,18 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('moveFolderAction', () => {
|
describe('moveFolderAction', () => {
|
||||||
let subject$: Subject<NodeChildAssociationEntry>;
|
|
||||||
beforeEach(() => {
|
|
||||||
subject$ = new Subject<NodeChildAssociationEntry>();
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => subject$.complete());
|
|
||||||
|
|
||||||
it('should not throw permission error in case it occurs on folder move', async(() => {
|
it('should not throw permission error in case it occurs on folder move', async(() => {
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(throwError(permissionError));
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.returnValue(throwError(permissionError));
|
||||||
|
|
||||||
const moveFolderActionObservable = service.moveFolderAction(folderToMove.entry, folderDestinationId);
|
service
|
||||||
moveFolderActionObservable
|
.moveFolderAction(folderToMove.entry, folderDestinationId)
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(
|
.then(
|
||||||
(value) => {
|
(value) => spyOnSuccess(value),
|
||||||
spyOnSuccess(value);
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
expect(spyOnSuccess).toHaveBeenCalledWith(permissionError);
|
||||||
expect(spyOnError).not.toHaveBeenCalled();
|
expect(spyOnError).not.toHaveBeenCalled();
|
||||||
@@ -936,8 +858,9 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
it('should not throw error on conflict in case it occurs on folder move', async(() => {
|
it('should not throw error on conflict in case it occurs on folder move', async(() => {
|
||||||
const newDestination = new TestNode('new-destination', !isFile, folderToMove.entry.name) as NodeChildAssociationEntry;
|
const newDestination = new TestNode('new-destination', !isFile, folderToMove.entry.name) as NodeChildAssociationEntry;
|
||||||
|
spyOn(documentListService, 'moveNode').and.returnValue(throwError(conflictError));
|
||||||
|
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.returnValue(throwError(conflictError));
|
const subject$ = new Subject<NodeChildAssociationEntry>();
|
||||||
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
||||||
spyOn(service, 'getNodeChildren').and.returnValue(of(emptyChildrenList));
|
spyOn(service, 'getNodeChildren').and.returnValue(of(emptyChildrenList));
|
||||||
|
|
||||||
@@ -951,15 +874,16 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
it('should try to move children nodes of a folder to already existing folder with same name', async(() => {
|
it('should try to move children nodes of a folder to already existing folder with same name', async(() => {
|
||||||
const parentFolderToMove = new TestNode('parent-folder', !isFile, 'conflicting-name');
|
const parentFolderToMove = new TestNode('parent-folder', !isFile, 'conflicting-name');
|
||||||
spyOnDocumentListServiceAction = spyOn(documentListService, 'moveNode').and.callFake((contentEntryId) => {
|
const moveNodeSpy = spyOn(documentListService, 'moveNode').and.callFake((nodeId: string, _targetParentId: string) => {
|
||||||
if (contentEntryId === parentFolderToMove.entry.id) {
|
if (nodeId === parentFolderToMove.entry.id) {
|
||||||
return throwError(conflictError);
|
return throwError(conflictError);
|
||||||
}
|
}
|
||||||
return of({});
|
return of({} as NodeEntry);
|
||||||
});
|
});
|
||||||
spyOn(service, 'moveContentAction').and.returnValue(of({}));
|
spyOn(service, 'moveContentAction').and.returnValue(of({}));
|
||||||
|
|
||||||
const newDestination = new TestNode('new-destination', !isFile, 'conflicting-name') as NodeChildAssociationEntry;
|
const newDestination = new TestNode('new-destination', !isFile, 'conflicting-name') as NodeChildAssociationEntry;
|
||||||
|
const subject$ = new Subject<NodeChildAssociationEntry>();
|
||||||
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
||||||
const childrenNodes = [fileToMove, folderToMove];
|
const childrenNodes = [fileToMove, folderToMove];
|
||||||
spyOn(service, 'getNodeChildren').and.returnValue(of({ list: { entries: childrenNodes } }));
|
spyOn(service, 'getNodeChildren').and.returnValue(of({ list: { entries: childrenNodes } }));
|
||||||
@@ -967,7 +891,7 @@ describe('NodeActionsService', () => {
|
|||||||
service.moveFolderAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
service.moveFolderAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
||||||
subject$.next(newDestination);
|
subject$.next(newDestination);
|
||||||
|
|
||||||
expect(spyOnDocumentListServiceAction).toHaveBeenCalled();
|
expect(moveNodeSpy).toHaveBeenCalled();
|
||||||
expect(spyOnSuccess).toHaveBeenCalled();
|
expect(spyOnSuccess).toHaveBeenCalled();
|
||||||
expect(spyOnError).not.toHaveBeenCalledWith(conflictError);
|
expect(spyOnError).not.toHaveBeenCalledWith(conflictError);
|
||||||
}));
|
}));
|
||||||
@@ -975,9 +899,8 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
describe('moveNodeAction', () => {
|
describe('moveNodeAction', () => {
|
||||||
describe('on moving folder to a destination where a folder with the same name exists', () => {
|
describe('on moving folder to a destination where a folder with the same name exists', () => {
|
||||||
let parentFolderToMove;
|
let parentFolderToMove: TestNode;
|
||||||
let moveNodeActionPromise;
|
let spyOnDelete: jasmine.Spy;
|
||||||
let spyOnDelete;
|
|
||||||
let subject$: Subject<NodeChildAssociationEntry>;
|
let subject$: Subject<NodeChildAssociationEntry>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -986,26 +909,15 @@ describe('NodeActionsService', () => {
|
|||||||
spyOnDelete = spyOn(contentApi, 'deleteNode').and.returnValue(of(null));
|
spyOnDelete = spyOn(contentApi, 'deleteNode').and.returnValue(of(null));
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
spyOnDelete.calls.reset();
|
|
||||||
spyOnSuccess.calls.reset();
|
|
||||||
spyOnError.calls.reset();
|
|
||||||
subject$.complete();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should take no extra delete action, if folder was moved to the same location', async(() => {
|
it('should take no extra delete action, if folder was moved to the same location', async(() => {
|
||||||
spyOn(service, 'moveFolderAction').and.returnValue(of(null));
|
spyOn(service, 'moveFolderAction').and.returnValue(of(null));
|
||||||
|
|
||||||
parentFolderToMove.entry.parentId = folderDestinationId;
|
parentFolderToMove.entry.parentId = folderDestinationId;
|
||||||
moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).toPromise();
|
const moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).toPromise();
|
||||||
moveNodeActionPromise
|
moveNodeActionPromise
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDelete).not.toHaveBeenCalled();
|
expect(spyOnDelete).not.toHaveBeenCalled();
|
||||||
@@ -1025,15 +937,11 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
||||||
moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).toPromise();
|
const moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).toPromise();
|
||||||
moveNodeActionPromise
|
moveNodeActionPromise
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => spyOnSuccess(),
|
||||||
spyOnSuccess();
|
(error) => spyOnError(error)
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
spyOnError(error);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(spyOnDelete).not.toHaveBeenCalled();
|
expect(spyOnDelete).not.toHaveBeenCalled();
|
||||||
@@ -1056,7 +964,7 @@ describe('NodeActionsService', () => {
|
|||||||
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
||||||
|
|
||||||
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
||||||
moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
||||||
subject$.next(folderOnLocation);
|
subject$.next(folderOnLocation);
|
||||||
|
|
||||||
expect(spyOnDelete).toHaveBeenCalled();
|
expect(spyOnDelete).toHaveBeenCalled();
|
||||||
@@ -1067,6 +975,7 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
it('should take no extra delete action, if folder is no longer on location', async(() => {
|
it('should take no extra delete action, if folder is no longer on location', async(() => {
|
||||||
const movedChildrenNodes = [fileToMove, folderToMove];
|
const movedChildrenNodes = [fileToMove, folderToMove];
|
||||||
|
|
||||||
spyOn(service, 'moveFolderAction').and.returnValue(of(movedChildrenNodes));
|
spyOn(service, 'moveFolderAction').and.returnValue(of(movedChildrenNodes));
|
||||||
spyOn(service, 'processResponse').and.returnValue({
|
spyOn(service, 'processResponse').and.returnValue({
|
||||||
succeeded: [movedChildrenNodes],
|
succeeded: [movedChildrenNodes],
|
||||||
@@ -1076,7 +985,7 @@ describe('NodeActionsService', () => {
|
|||||||
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
spyOn(service, 'getChildByName').and.returnValue(subject$);
|
||||||
|
|
||||||
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
parentFolderToMove.entry.parentId = `not-${folderDestinationId}`;
|
||||||
moveNodeActionPromise = service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
service.moveNodeAction(parentFolderToMove.entry, folderDestinationId).subscribe(spyOnSuccess, spyOnError);
|
||||||
subject$.next(null);
|
subject$.next(null);
|
||||||
|
|
||||||
expect(spyOnDelete).not.toHaveBeenCalled();
|
expect(spyOnDelete).not.toHaveBeenCalled();
|
||||||
@@ -1088,9 +997,9 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('getChildByName', () => {
|
describe('getChildByName', () => {
|
||||||
let testFamilyNodes;
|
let testFamilyNodes: Array<{ parentNodeId: string; nodeChildren: TestNode[] }>;
|
||||||
let notChildNode;
|
let notChildNode: TestNode;
|
||||||
let childNode;
|
let childNode: TestNode;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
childNode = new TestNode(fileId, isFile, 'child-name');
|
childNode = new TestNode(fileId, isFile, 'child-name');
|
||||||
@@ -1135,7 +1044,7 @@ describe('NodeActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('getNewNameFrom', () => {
|
describe('getNewNameFrom', () => {
|
||||||
const testData = [
|
const testData: Array<{ name: string; baseName: string; expected: string }> = [
|
||||||
{
|
{
|
||||||
name: 'noExtension',
|
name: 'noExtension',
|
||||||
baseName: 'noExtension',
|
baseName: 'noExtension',
|
||||||
|
Reference in New Issue
Block a user