[ACA-1574] DocumentList - single click navigation (#513)

* single click navigation

* fix tests

* allow action on row

* use adf link class

* update tests
This commit is contained in:
Cilibiu Bogdan
2018-07-18 18:25:30 +03:00
committed by Denys Vuika
parent 36629adf99
commit af4089ae74
7 changed files with 36 additions and 34 deletions

View File

@@ -163,35 +163,23 @@ describe('LibrariesComponent', () => {
});
});
describe('onNodeDoubleClick', () => {
it('navigates to document', () => {
describe('navigateTo', () => {
it('navigates into library folder', () => {
spyOn(component, 'navigate');
const event: any = {
detail: {
node: {
entry: { guid: 'node-guid' }
}
}
const site: any = {
entry: { guid: 'node-guid' }
};
component.onNodeDoubleClick(event);
component.navigateTo(site);
expect(component.navigate).toHaveBeenCalledWith('node-guid');
});
it(' does not navigate when document is not provided', () => {
it(' does not navigate when library is not provided', () => {
spyOn(component, 'navigate');
const event: any = {
detail: {
node: {
entry: null
}
}
};
component.onNodeDoubleClick(event);
component.navigateTo(null);
expect(component.navigate).not.toHaveBeenCalled();
});