Create Folder directive enhancement: custom nodeType (#3214)

This commit is contained in:
Popovics András
2018-04-19 13:03:38 +01:00
committed by Eugenio Romano
parent 0ff0573401
commit deb09e4d5f
7 changed files with 138 additions and 72 deletions

View File

@@ -299,7 +299,30 @@ describe('FolderDialogComponent', () => {
properties: {
'cm:title': 'folder-name-update',
'cm:description': 'folder-description-update'
}
},
nodeType: 'cm:folder'
}
);
});
it('should submit updated values if form is valid (with custom nodeType)', () => {
spyOn(nodesApi, 'createFolder').and.returnValue(Observable.of({}));
component.form.controls['name'].setValue('folder-name-update');
component.form.controls['description'].setValue('folder-description-update');
component.nodeType = 'cm:sushi';
component.submit();
expect(nodesApi.createFolder).toHaveBeenCalledWith(
'parentNodeId',
{
name: 'folder-name-update',
properties: {
'cm:title': 'folder-name-update',
'cm:description': 'folder-description-update'
},
nodeType: 'cm:sushi'
}
);
});