[ACA-2087] Overlay Viewer (#1175)

* viewer outlet over preview route

* use ViewNodeAction over ViewFileAction

* pass data to dynamic component

* ViewNodeComponent for view file  custom actions

* update docs

* pass primary url to show preview outlet

* update tests

* reset selection on navigation event

* document list update selection action when not viewer

* close viewer for move and delete from viewer

* location as router commands to work with search query

* make viewer to behave like former preview

* viewer error route

* call correct preview method

* remove view/error route

* navigate to show error

* span element for action name

* fix folder navigation

* fix test

* page title fix

* update tests

* locate better the viewer toolbar

* fix viewer url  link

* update navigation rules

* document-list directive tests

* try workaround for chrome 76

* try another workaround for using chromedriver 75 instead of 76

* ViewerEffects tests

* reset selection over reload

* fix tests

* add reset event test

* remove actions

* context menu action refresh on favourite

* reset selection on navigation

* add delete and upload events

* takeUntil after operators

* remove chrome workaround parameter

* filter navigation event
This commit is contained in:
Cilibiu Bogdan
2019-08-08 15:38:50 +03:00
committed by Suzana Dirla
parent 8643a8806d
commit e31c0d6caf
43 changed files with 1256 additions and 238 deletions

View File

@@ -49,9 +49,12 @@ describe('FilesComponent', () => {
let fixture: ComponentFixture<FilesComponent>;
let component: FilesComponent;
let uploadService: UploadService;
let router: Router;
let nodeActionsService: NodeActionsService;
let contentApi: ContentApiService;
let router = {
url: '',
navigate: jasmine.createSpy('navigate')
};
beforeEach(() => {
TestBed.configureTestingModule({
@@ -64,6 +67,10 @@ describe('FilesComponent', () => {
AppConfigPipe
],
providers: [
{
provide: Router,
useValue: router
},
{
provide: ActivatedRoute,
useValue: {
@@ -122,7 +129,6 @@ describe('FilesComponent', () => {
node.isFolder = false;
node.parentId = 'parent-id';
spyOn(contentApi, 'getNode').and.returnValue(of({ entry: node }));
spyOn(router, 'navigate');
fixture.detectChanges();
@@ -231,24 +237,24 @@ describe('FilesComponent', () => {
describe('Node navigation', () => {
beforeEach(() => {
spyOn(contentApi, 'getNode').and.returnValue(of({ entry: node }));
spyOn(router, 'navigate');
fixture.detectChanges();
});
it('should navigates to node when id provided', () => {
router.url = '/personal-files';
component.navigate(node.id);
expect(router.navigate).toHaveBeenCalledWith(
['./', node.id],
jasmine.any(Object)
);
expect(router.navigate).toHaveBeenCalledWith([
'/personal-files',
node.id
]);
});
it('should navigates to home when id not provided', () => {
router.url = '/personal-files';
component.navigate();
expect(router.navigate).toHaveBeenCalledWith(['./'], jasmine.any(Object));
expect(router.navigate).toHaveBeenCalledWith(['/personal-files']);
});
it('should navigate home if node is root', () => {
@@ -258,9 +264,10 @@ describe('FilesComponent', () => {
}
};
router.url = '/personal-files';
component.navigate(node.id);
expect(router.navigate).toHaveBeenCalledWith(['./'], jasmine.any(Object));
expect(router.navigate).toHaveBeenCalledWith(['/personal-files']);
});
});