mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-9765]: adds check for being rma content
This commit is contained in:
@@ -216,4 +216,21 @@ describe('ContentService', () => {
|
||||
expect(contentService.getNodeIcon(node)).toContain('assets/images/ft_ic_miscellaneous');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isRmaContent', () => {
|
||||
it('should return true if nodeType starts with rma:', () => {
|
||||
const rmaNode = new Node({ nodeType: 'rma:hold' });
|
||||
expect(contentService.isRmaContent(rmaNode)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return false for misplaced key word', () => {
|
||||
const rmaFolder = new Node({ nodeType: 'cm:rma:recordFolder' });
|
||||
expect(contentService.isRmaContent(rmaFolder)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false if nodeType does not start with rma:', () => {
|
||||
const contentNode = new Node({ nodeType: 'cm:content' });
|
||||
expect(contentService.isRmaContent(contentNode)).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -189,6 +189,10 @@ export class ContentService {
|
||||
return node?.nodeType === 'app:folderlink';
|
||||
}
|
||||
|
||||
isRmaContent(node: Node): boolean {
|
||||
return node?.nodeType.startsWith('rma:');
|
||||
}
|
||||
|
||||
private hasAspect(node: Node, aspectName: string): boolean {
|
||||
return node?.aspectNames?.includes(aspectName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user