mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-2471] - close preview action (#1129)
This commit is contained in:
@@ -39,6 +39,7 @@ import {
|
||||
UploadService,
|
||||
AlfrescoApiService
|
||||
} from '@alfresco/adf-core';
|
||||
import { ClosePreviewAction } from '@alfresco/aca-shared/store';
|
||||
import { PreviewComponent } from './preview.component';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
@@ -46,6 +47,7 @@ import { NodeEffects } from '../../store/effects/node.effects';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
describe('PreviewComponent', () => {
|
||||
let fixture: ComponentFixture<PreviewComponent>;
|
||||
@@ -57,6 +59,7 @@ describe('PreviewComponent', () => {
|
||||
let uploadService: UploadService;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
let contentManagementService: ContentManagementService;
|
||||
let store: Store<any>;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -76,6 +79,7 @@ describe('PreviewComponent', () => {
|
||||
uploadService = TestBed.get(UploadService);
|
||||
alfrescoApiService = TestBed.get(AlfrescoApiService);
|
||||
contentManagementService = TestBed.get(ContentManagementService);
|
||||
store = TestBed.get(Store);
|
||||
});
|
||||
|
||||
it('should extract the property path root', () => {
|
||||
@@ -732,4 +736,11 @@ describe('PreviewComponent', () => {
|
||||
|
||||
expect(alfrescoApiService.nodeUpdated.next).toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
it('should return to parent folder when event emitted from extension', async(() => {
|
||||
spyOn(component, 'navigateToFileLocation');
|
||||
fixture.detectChanges();
|
||||
store.dispatch(new ClosePreviewAction());
|
||||
expect(component.navigateToFileLocation).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
Reference in New Issue
Block a user