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);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
store.resetSelectors();
|
||||
});
|
||||
|
||||
it('should have assigned displayDragAndDropHint to false if currentFolder is selected and uploading is not allowable', () => {
|
||||
store.overrideSelector(getCurrentFolder, node);
|
||||
spyOn(documentBasePageService, 'canUploadContent').and.returnValue(false);
|
||||
|
@ -24,22 +24,15 @@
|
||||
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { UploadService, NodesApiService, DiscoveryApiService } from '@alfresco/adf-content-services';
|
||||
import { UploadService, NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { ClosePreviewAction } from '@alfresco/aca-shared/store';
|
||||
import { PreviewComponent } from './preview.component';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import {
|
||||
ContentApiService,
|
||||
AppHookService,
|
||||
DocumentBasePageService,
|
||||
LibTestingModule,
|
||||
discoveryApiServiceMockValue,
|
||||
DocumentBasePageServiceMock
|
||||
} from '@alfresco/aca-shared';
|
||||
import { ContentApiService, AppHookService, DocumentBasePageService, DocumentBasePageServiceMock } from '@alfresco/aca-shared';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { AcaViewerModule } from '../../viewer.module';
|
||||
import { AppTestingModule } from '../../../../../src/lib/testing/app-testing.module';
|
||||
|
||||
const clickEvent = new MouseEvent('click');
|
||||
|
||||
@ -56,11 +49,12 @@ describe('PreviewComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [LibTestingModule, AcaViewerModule],
|
||||
imports: [AppTestingModule, AcaViewerModule],
|
||||
providers: [
|
||||
{ provide: DocumentBasePageService, useValue: DocumentBasePageServiceMock },
|
||||
{ provide: DiscoveryApiService, useValue: discoveryApiServiceMockValue },
|
||||
{ provide: AuthenticationService, useValue: {} }
|
||||
{
|
||||
provide: DocumentBasePageService,
|
||||
useClass: DocumentBasePageServiceMock
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user