mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-4323] Can't add aspects to a folder in ACA/ADW (#2041)
* [ACA-4323] Can't add aspects to a folder in ACA/ADW * * Added unit tests
This commit is contained in:
@@ -472,17 +472,30 @@ describe('NodeEffects', () => {
|
||||
expect(contentService.manageAspects).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call aspect dialog from the active selection', fakeAsync(() => {
|
||||
it('should call aspect dialog from the active file selection', fakeAsync(() => {
|
||||
spyOn(contentService, 'manageAspects').and.stub();
|
||||
|
||||
const node: any = { entry: { isFile: true } };
|
||||
const node: any = { entry: { isFile: true, id: 'file-node-id' } };
|
||||
store.dispatch(new SetSelectedNodesAction([node]));
|
||||
|
||||
tick(100);
|
||||
|
||||
store.dispatch(new ManageAspectsAction(null));
|
||||
|
||||
expect(contentService.manageAspects).toHaveBeenCalled();
|
||||
expect(contentService.manageAspects).toHaveBeenCalledWith({ entry: { isFile: true, id: 'file-node-id' } });
|
||||
}));
|
||||
|
||||
it('should call aspect dialog from the active folder selection', fakeAsync(() => {
|
||||
spyOn(contentService, 'manageAspects').and.stub();
|
||||
|
||||
const node: any = { entry: { isFile: false, id: 'folder-node-id' } };
|
||||
store.dispatch(new SetSelectedNodesAction([node]));
|
||||
|
||||
tick(100);
|
||||
|
||||
store.dispatch(new ManageAspectsAction(null));
|
||||
|
||||
expect(contentService.manageAspects).toHaveBeenCalledWith({ entry: { isFile: false, id: 'folder-node-id' } });
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -328,8 +328,8 @@ export class NodeEffects {
|
||||
.select(getAppSelection)
|
||||
.pipe(take(1))
|
||||
.subscribe((selection) => {
|
||||
if (selection && selection.file) {
|
||||
this.contentService.manageAspects(selection.file);
|
||||
if (selection && !selection.isEmpty) {
|
||||
this.contentService.manageAspects(selection.nodes[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user