[ADF-5027] Fix APS rendition (#5285)

* fix APS rendition

* fix unit

* fix unit
This commit is contained in:
Eugenio Romano
2019-11-27 15:48:04 +00:00
committed by GitHub
parent 094cf4ac0f
commit 8541591816
3 changed files with 6 additions and 3 deletions

View File

@@ -194,7 +194,7 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn
} }
emitDocumentContent(content: any) { emitDocumentContent(content: any) {
this.activitiContentService.getFileRawContent(content.id).subscribe( this.activitiContentService.getContentPreview(content.id).subscribe(
(blob: Blob) => { (blob: Blob) => {
content.contentBlob = blob; content.contentBlob = blob;
this.attachmentClick.emit(content); this.attachmentClick.emit(content);

View File

@@ -32,6 +32,7 @@ describe('TaskAttachmentList', () => {
let mockAttachment: any; let mockAttachment: any;
let deleteContentSpy: jasmine.Spy; let deleteContentSpy: jasmine.Spy;
let getFileRawContentSpy: jasmine.Spy; let getFileRawContentSpy: jasmine.Spy;
let getContentPreviewSpy: jasmine.Spy;
let disposableSuccess: any; let disposableSuccess: any;
setupTestBed({ setupTestBed({
@@ -87,6 +88,8 @@ describe('TaskAttachmentList', () => {
deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(of({ successCode: true })); deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(of({ successCode: true }));
const blobObj = new Blob(); const blobObj = new Blob();
getContentPreviewSpy = spyOn(service, 'getContentPreview').and.returnValue(of(blobObj));
getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj)); getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj));
}); });
@@ -144,7 +147,7 @@ describe('TaskAttachmentList', () => {
it('emit document when a user wants to view the document', () => { it('emit document when a user wants to view the document', () => {
component.emitDocumentContent(mockAttachment.data[1]); component.emitDocumentContent(mockAttachment.data[1]);
fixture.detectChanges(); fixture.detectChanges();
expect(getFileRawContentSpy).toHaveBeenCalled(); expect(getContentPreviewSpy).toHaveBeenCalled();
}); });
it('download document when a user wants to view the document', () => { it('download document when a user wants to view the document', () => {

View File

@@ -204,7 +204,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
} }
emitDocumentContent(content: any) { emitDocumentContent(content: any) {
this.activitiContentService.getFileRawContent(content.id).subscribe( this.activitiContentService.getContentPreview(content.id).subscribe(
(blob: Blob) => { (blob: Blob) => {
content.contentBlob = blob; content.contentBlob = blob;
this.attachmentClick.emit(content); this.attachmentClick.emit(content);