[ADF-523] Fix delete operation in the search component (#2020)

* Search delete permission notification fix

* Support content deletion inside search results

* Forgotten broken test fix.

* Update alfresco-document-list READDME.md

* Update alfresco-document-list READDME.md II

* Adding TOC to README.md

* Build fix

* Fix the build for now and ever!
This commit is contained in:
Popovics András
2017-07-06 09:45:03 +01:00
committed by Eugenio Romano
parent c008efbb96
commit 4243e0eb25
14 changed files with 214 additions and 46 deletions

View File

@@ -22,8 +22,9 @@ import { Observable } from 'rxjs/Rx';
import { AlfrescoSearchComponent } from './alfresco-search.component';
import { TranslationMock } from './../assets/translation.service.mock';
import { AlfrescoSearchService } from '../services/alfresco-search.service';
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
import { AlfrescoTranslationService, CoreModule, NotificationService } from 'ng2-alfresco-core';
import { DocumentListModule } from 'ng2-alfresco-documentlist';
import { PermissionModel } from 'ng2-alfresco-documentlist';
describe('AlfrescoSearchComponent', () => {
@@ -104,7 +105,8 @@ describe('AlfrescoSearchComponent', () => {
declarations: [AlfrescoSearchComponent], // declare the test component
providers: [
AlfrescoSearchService,
{ provide: AlfrescoTranslationService, useClass: TranslationMock }
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
{ provide: NotificationService, useClass: NotificationService }
]
}).compileComponents().then(() => {
fixture = TestBed.createComponent(AlfrescoSearchComponent);
@@ -126,7 +128,7 @@ describe('AlfrescoSearchComponent', () => {
{provide: ActivatedRoute, useValue: {params: Observable.from([{q: 'exampleTerm692'}])}}
]);
let search = new AlfrescoSearchComponent(null, null, injector.get(ActivatedRoute));
let search = new AlfrescoSearchComponent(null, null, null, injector.get(ActivatedRoute));
search.ngOnInit();
@@ -142,11 +144,20 @@ describe('AlfrescoSearchComponent', () => {
expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search');
});
it('should show the Notification snackbar on permission error', () => {
const notoficationService = TestBed.get(NotificationService);
spyOn(notoficationService, 'openSnackMessage');
component.handlePermission(new PermissionModel());
expect(notoficationService.openSnackMessage).toHaveBeenCalledWith('PERMISSON.LACKOF', 3000);
});
describe('Search results', () => {
it('should call search service with the correct parameters', (done) => {
let searchTerm = 'searchTerm63688', options = {
include: ['path'],
include: ['path', 'allowableOperations'],
skipCount: 0,
rootNodeId: '-my-',
nodeType: 'my:type',