[ACS-9765]: adds check for being rma content

This commit is contained in:
Anton Ramanovich
2026-03-10 13:26:18 +01:00
parent 99e3c87eb0
commit 42de69e9e1
2 changed files with 21 additions and 0 deletions
@@ -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);
}