mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -109,4 +109,35 @@ describe('AlfrescoSearchComponent', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('search result actions', () => {
|
||||
|
||||
it('should emit preview when file item clicked',
|
||||
inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
return tcb
|
||||
.overrideProviders(AlfrescoSearchComponent, [
|
||||
{ provide: AlfrescoSearchService, useClass: SearchServiceMock }
|
||||
])
|
||||
.createAsync(AlfrescoSearchComponent)
|
||||
.then((fixture) => {
|
||||
let componentInstance = fixture.componentInstance;
|
||||
componentInstance.results = [{
|
||||
entry: {
|
||||
id: '123',
|
||||
name: 'MyDoc',
|
||||
content: {
|
||||
mimetype: 'text/plain'
|
||||
},
|
||||
isFile: true
|
||||
}
|
||||
}];
|
||||
fixture.detectChanges(componentInstance.results[0]);
|
||||
componentInstance.preview.subscribe(e => {
|
||||
expect(e.value).toBe(componentInstance.results[0]);
|
||||
});
|
||||
componentInstance.onItemClick();
|
||||
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user