mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-8841] Fix viewer rendering for doc files (#10251)
* [ACS-8841] fix viewer rendering for doc files * [ACS-8841] fix test
This commit is contained in:
committed by
GitHub
parent
da44b4cee0
commit
28f51424cf
@@ -478,7 +478,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
});
|
||||
|
||||
describe('mimeType', () => {
|
||||
it('should set mime type based on nodeData content', async () => {
|
||||
it('should set mime type based on renditionMimeType rather then nodeData', async () => {
|
||||
const defaultNode: Node = {
|
||||
id: 'mock-id',
|
||||
name: 'Mock Node',
|
||||
@@ -496,7 +496,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
spyOn(renditionService, 'getNodeRendition').and.returnValue(
|
||||
Promise.resolve({
|
||||
url: '',
|
||||
mimeType: ''
|
||||
mimeType: 'application/pdf'
|
||||
})
|
||||
);
|
||||
|
||||
@@ -510,7 +510,7 @@ describe('AlfrescoViewerComponent', () => {
|
||||
} as Node);
|
||||
|
||||
await fixture.whenStable();
|
||||
expect(component.mimeType).toEqual('application/msWord');
|
||||
expect(component.mimeType).toEqual('application/pdf');
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -346,7 +346,7 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
const nodeMimeType = nodeData?.content?.mimeType;
|
||||
const renditionMimeType = nodeRendition.mimeType;
|
||||
mimeType = nodeMimeType || renditionMimeType;
|
||||
mimeType = renditionMimeType || nodeMimeType;
|
||||
}
|
||||
} else if (viewerType === 'media') {
|
||||
this.tracks = await this.renditionService.generateMediaTracksRendition(this.nodeId);
|
||||
|
Reference in New Issue
Block a user