mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4647] download service (#4836)
* split download api into separate service * move tests and fix code * break dependency for thumbnail service * update tests * test fixes * fix code * fix unit tests
This commit is contained in:
committed by
Eugenio Romano
parent
d0d1154f84
commit
a37f935c05
@@ -15,12 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, DataSorting, ContentService, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow, DataSorting, ContentService, ThumbnailService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode, SmartFolderNode, RuleFolderNode, LinkFolderNode } from './../../mock';
|
||||
import { ShareDataRow } from './share-data-row.model';
|
||||
import { ShareDataTableAdapter } from './share-datatable-adapter';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { MatIconRegistry } from '@angular/material';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
class FakeSanitizer extends DomSanitizer {
|
||||
|
||||
@@ -57,12 +59,26 @@ describe('ShareDataTableAdapter', () => {
|
||||
|
||||
let thumbnailService: ThumbnailService;
|
||||
let contentService: ContentService;
|
||||
const fakeMatIconRegistry: MatIconRegistry = jasmine.createSpyObj(['addSvgIcon', 'addSvgIconInNamespace']);
|
||||
|
||||
setupTestBed({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [
|
||||
{
|
||||
provide: MatIconRegistry,
|
||||
useValue: jasmine.createSpyObj(['addSvgIcon', 'addSvgIconInNamespace'])
|
||||
},
|
||||
{
|
||||
provide: DomSanitizer, useClass: FakeSanitizer
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
const imageUrl: string = 'http://<addresss>';
|
||||
contentService = new ContentService(null, null, null, null);
|
||||
thumbnailService = new ThumbnailService(contentService, fakeMatIconRegistry, new FakeSanitizer());
|
||||
|
||||
contentService = TestBed.get(ContentService);
|
||||
thumbnailService = TestBed.get(ThumbnailService);
|
||||
|
||||
spyOn(thumbnailService, 'getDocumentThumbnailUrl').and.returnValue(imageUrl);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user