[ACA-213] Edit Offline - permissions (#911)

* edit offline action rules

* unlock node error message

* update extensions rules

* lock unlock evaluators

* LockNodeDirective over EditOfflineDirective

* disable tests failing cause of unrelated bug

* isUserWriteLockOwner over isUserWriteLock
This commit is contained in:
Cilibiu Bogdan
2019-02-05 20:39:11 +02:00
committed by Denys Vuika
parent f7ed576847
commit 913685eb14
11 changed files with 105 additions and 54 deletions

View File

@@ -24,7 +24,7 @@
*/
import { ToggleEditOfflineComponent } from './toggle-edit-offline.component';
import { EditOfflineDirective } from '../../../directives/edit-offline.directive';
import { LockNodeDirective } from '../../../directives/lock-node.directive';
import { setupTestBed, CoreModule } from '@alfresco/adf-core';
import { TestBed } from '@angular/core/testing';
import { of } from 'rxjs';
@@ -44,7 +44,7 @@ describe('ToggleEditOfflineComponent', () => {
setupTestBed({
imports: [CoreModule],
declarations: [ToggleEditOfflineComponent, EditOfflineDirective],
declarations: [ToggleEditOfflineComponent, LockNodeDirective],
providers: [
{
provide: Store,
@@ -115,12 +115,12 @@ describe('ToggleEditOfflineComponent', () => {
]);
});
it('should raise notification on error', () => {
it('should raise notification on lock error', () => {
component.selection = {
entry: { name: 'test' }
};
component.onError();
component.onLockError();
fixture.detectChanges();
expect(dispatchSpy.calls.argsFor(0)).toEqual([
@@ -129,4 +129,19 @@ describe('ToggleEditOfflineComponent', () => {
})
]);
});
it('should raise notification on unlock error', () => {
component.selection = {
entry: { name: 'test' }
};
component.onUnlockLockError();
fixture.detectChanges();
expect(dispatchSpy.calls.argsFor(0)).toEqual([
new SnackbarErrorAction('APP.MESSAGES.ERRORS.UNLOCK_NODE', {
fileName: 'test'
})
]);
});
});