From 647aa9869e1870692a543124561dfe9f16826ba8 Mon Sep 17 00:00:00 2001 From: milad-emami Date: Sat, 23 Nov 2024 10:39:30 +0330 Subject: [PATCH] fix: update filesize import to use named export --- src/components/FilePopoverContent/index.jsx | 2 +- src/components/FilePopoverContent/index.test.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FilePopoverContent/index.jsx b/src/components/FilePopoverContent/index.jsx index f5c13054..fa58e5c0 100644 --- a/src/components/FilePopoverContent/index.jsx +++ b/src/components/FilePopoverContent/index.jsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@edx/frontend-platform/i18n'; -import filesize from 'filesize'; +import { filesize } from 'filesize'; import messages from './messages'; diff --git a/src/components/FilePopoverContent/index.test.jsx b/src/components/FilePopoverContent/index.test.jsx index 1f917350..a1795d63 100644 --- a/src/components/FilePopoverContent/index.test.jsx +++ b/src/components/FilePopoverContent/index.test.jsx @@ -1,10 +1,12 @@ import React from 'react'; import { shallow } from '@edx/react-unit-test-utils'; -import filesize from 'filesize'; +import { filesize } from 'filesize'; import FilePopoverContent from '.'; -jest.mock('filesize', () => (size) => `filesize(${size})`); +jest.mock('filesize', () => ({ + filesize: (size) => `filesize(${size})`, +})); describe('FilePopoverContent', () => { describe('component', () => {