mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6278] - Permissions manager should not be showed for smart folder (#3580)
This commit is contained in:
@@ -30,7 +30,7 @@ import { BehaviorSubject, of, Subject } from 'rxjs';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { STORE_INITIAL_APP_DATA, SetSelectedNodesAction, NavigateToFolder } from '@alfresco/aca-shared/store';
|
||||
import { NavigateToFolder, SetSelectedNodesAction, STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store';
|
||||
import { NodeEntry, PathElement } from '@alfresco/js-api';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { AuthenticationService, PageTitleService } from '@alfresco/adf-core';
|
||||
@@ -201,4 +201,45 @@ describe('DetailsComponent', () => {
|
||||
fail(`An error occurred: ${error}`);
|
||||
});
|
||||
});
|
||||
|
||||
it('should disable the permissions tab for smart folders based on aspects', () => {
|
||||
node.entry.isFolder = true;
|
||||
node.entry.aspectNames = ['smf:customConfigSmartFolder'];
|
||||
fixture.detectChanges();
|
||||
component.ngOnInit();
|
||||
expect(component.canManagePermissions).toBeFalse();
|
||||
expect(component.activeTab).not.toBe(2);
|
||||
});
|
||||
|
||||
it('should enable the permissions tab for regular folders based on aspects', () => {
|
||||
node.entry.isFolder = true;
|
||||
node.entry.aspectNames = [];
|
||||
fixture.detectChanges();
|
||||
component.ngOnInit();
|
||||
|
||||
expect(component.canManagePermissions).toBeTrue();
|
||||
});
|
||||
|
||||
it('should change active tab based on canManagePermissions and tabName', () => {
|
||||
component.nodeId = 'someNodeId';
|
||||
component.activeTab = 0;
|
||||
|
||||
node.entry.isFolder = true;
|
||||
node.entry.aspectNames = [];
|
||||
|
||||
fixture.detectChanges();
|
||||
component.ngOnInit();
|
||||
|
||||
component.setActiveTab('permissions');
|
||||
expect(component.activeTab).toBe(2);
|
||||
|
||||
node.entry.isFolder = true;
|
||||
node.entry.aspectNames = ['smf:customConfigSmartFolder'];
|
||||
|
||||
fixture.detectChanges();
|
||||
component.ngOnInit();
|
||||
|
||||
component.setActiveTab('permissions');
|
||||
expect(component.activeTab).not.toBe(2);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user