Skip to content

Commit

Permalink
[ACS-8841] Fix viewer rendering for doc files (#10251)
Browse files Browse the repository at this point in the history
* [ACS-8841] fix viewer rendering for doc files

* [ACS-8841] fix test
  • Loading branch information
nikita-web-ua authored Sep 27, 2024
1 parent da44b4c commit 28f5142
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -496,7 +496,7 @@ describe('AlfrescoViewerComponent', () => {
spyOn(renditionService, 'getNodeRendition').and.returnValue(
Promise.resolve({
url: '',
mimeType: ''
mimeType: 'application/pdf'
})
);

Expand All @@ -510,7 +510,7 @@ describe('AlfrescoViewerComponent', () => {
} as Node);

await fixture.whenStable();
expect(component.mimeType).toEqual('application/msWord');
expect(component.mimeType).toEqual('application/pdf');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 28f5142

Please sign in to comment.