Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/viewers/doc/DocBaseViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class DocBaseViewer extends BaseViewer {
* @return {void}
*/
loadViewerAssets() {
const ASSETS = this.featureEnabled(DOC_FIRST_PAGES_ENABLED) ? [...JS_NO_EXIF, ...EXIF_READER] : JS;
const ASSETS = [...JS_NO_EXIF, ...EXIF_READER];
this.loadAssets(ASSETS, CSS);
this.loadAssets(PRELOAD_JS, []);
}
Expand Down
12 changes: 1 addition & 11 deletions src/lib/viewers/doc/__tests__/DocBaseViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,17 +966,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
jest.restoreAllMocks();
});

test('should load JS and CSS assets when docFirstPages is disabled', () => {
testDocBase.loadViewerAssets();
expect(testDocBase.loadAssets).toHaveBeenCalledTimes(2);
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(1, JS, CSS);
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(2, PRELOAD_JS, []);
});

test('should load JS_NO_EXIF and EXIF_READER assets when docFirstPages is enabled', () => {
testDocBase.options.features = {
'docFirstPages.enabled': true,
};
test('should load PDFJS and EXIF_READER', () => {
testDocBase.loadViewerAssets();
expect(testDocBase.loadAssets).toHaveBeenCalledTimes(2);
expect(testDocBase.loadAssets).toHaveBeenNthCalledWith(1, [...JS_NO_EXIF, ...EXIF_READER], CSS);
Expand Down