mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-26 17:24:45 +00:00
[ACA-2221] Lock node - check selection is not null (#966)
* check selection is not null * test
This commit is contained in:
parent
52a4740463
commit
4ed77d45bb
@ -69,6 +69,12 @@ describe('LockNodeDirective', () => {
|
||||
api = TestBed.get(AlfrescoApiService);
|
||||
});
|
||||
|
||||
it('should return false if selection is null', () => {
|
||||
component.selection = null;
|
||||
fixture.detectChanges();
|
||||
expect(component.directive.isNodeLocked()).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if selection is not locked', () => {
|
||||
component.selection = { entry: { name: 'test-name', properties: {} } };
|
||||
fixture.detectChanges();
|
||||
|
@ -54,7 +54,7 @@ export class LockNodeDirective {
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {}
|
||||
|
||||
isNodeLocked(): boolean {
|
||||
return isLocked(this.node);
|
||||
return !!(this.node && isLocked(this.node));
|
||||
}
|
||||
|
||||
private async toggleLock(node: NodeEntry | SharedLinkEntry) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user