mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-9536] fix failing unit tests (#4556)
* [ACS-9536] fix failing unit tests, use correct testing module * [ACS-9536] provide mock service for preview unit tests
This commit is contained in:
parent
311efee36d
commit
325d072c4d
@ -491,6 +491,10 @@ describe('FilesComponent', () => {
|
|||||||
documentBasePageService = TestBed.inject(DocumentBasePageService);
|
documentBasePageService = TestBed.inject(DocumentBasePageService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
store.resetSelectors();
|
||||||
|
});
|
||||||
|
|
||||||
it('should have assigned displayDragAndDropHint to false if currentFolder is selected and uploading is not allowable', () => {
|
it('should have assigned displayDragAndDropHint to false if currentFolder is selected and uploading is not allowable', () => {
|
||||||
store.overrideSelector(getCurrentFolder, node);
|
store.overrideSelector(getCurrentFolder, node);
|
||||||
spyOn(documentBasePageService, 'canUploadContent').and.returnValue(false);
|
spyOn(documentBasePageService, 'canUploadContent').and.returnValue(false);
|
||||||
|
@ -24,22 +24,15 @@
|
|||||||
|
|
||||||
import { Router, ActivatedRoute } from '@angular/router';
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testing';
|
import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testing';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { UploadService, NodesApiService } from '@alfresco/adf-content-services';
|
||||||
import { UploadService, NodesApiService, DiscoveryApiService } from '@alfresco/adf-content-services';
|
|
||||||
import { ClosePreviewAction } from '@alfresco/aca-shared/store';
|
import { ClosePreviewAction } from '@alfresco/aca-shared/store';
|
||||||
import { PreviewComponent } from './preview.component';
|
import { PreviewComponent } from './preview.component';
|
||||||
import { of, throwError } from 'rxjs';
|
import { of, throwError } from 'rxjs';
|
||||||
import {
|
import { ContentApiService, AppHookService, DocumentBasePageService, DocumentBasePageServiceMock } from '@alfresco/aca-shared';
|
||||||
ContentApiService,
|
|
||||||
AppHookService,
|
|
||||||
DocumentBasePageService,
|
|
||||||
LibTestingModule,
|
|
||||||
discoveryApiServiceMockValue,
|
|
||||||
DocumentBasePageServiceMock
|
|
||||||
} from '@alfresco/aca-shared';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { AcaViewerModule } from '../../viewer.module';
|
import { AcaViewerModule } from '../../viewer.module';
|
||||||
|
import { AppTestingModule } from '../../../../../src/lib/testing/app-testing.module';
|
||||||
|
|
||||||
const clickEvent = new MouseEvent('click');
|
const clickEvent = new MouseEvent('click');
|
||||||
|
|
||||||
@ -56,11 +49,12 @@ describe('PreviewComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [LibTestingModule, AcaViewerModule],
|
imports: [AppTestingModule, AcaViewerModule],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DocumentBasePageService, useValue: DocumentBasePageServiceMock },
|
{
|
||||||
{ provide: DiscoveryApiService, useValue: discoveryApiServiceMockValue },
|
provide: DocumentBasePageService,
|
||||||
{ provide: AuthenticationService, useValue: {} }
|
useClass: DocumentBasePageServiceMock
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user