From f4c85d0b5132dd1caa7cb5228050345e66f13939 Mon Sep 17 00:00:00 2001 From: HadiKhai Date: Wed, 2 Jun 2021 20:30:18 +0200 Subject: [PATCH] fix: imports for constants inside the tests --- cypress/fixtures/apps.js | 2 +- cypress/fixtures/documents.js | 2 +- cypress/fixtures/files.js | 2 +- cypress/fixtures/items.js | 7 ++----- cypress/fixtures/links.js | 2 +- cypress/integration/item/copy/gridCopyItem.spec.js | 3 ++- cypress/integration/item/copy/listCopyItem.spec.js | 3 ++- cypress/integration/item/create/createApp.spec.js | 6 ++---- cypress/integration/item/create/createDocument.spec.js | 6 ++---- cypress/integration/item/create/createFile.spec.js | 6 ++---- cypress/integration/item/create/createFolder.spec.js | 6 ++---- cypress/integration/item/create/createLink.spec.js | 6 ++---- cypress/integration/item/create/createShortcut.spec.js | 7 ++----- cypress/integration/item/create/utils.js | 2 +- cypress/integration/item/delete/gridDeleteItem.spec.js | 2 +- cypress/integration/item/delete/listDeleteItem.spec.js | 6 ++---- .../integration/item/delete/listDeleteItems.spec.js | 6 ++---- cypress/integration/item/edit/editApp.spec.js | 6 ++---- cypress/integration/item/edit/editDocument.spec.js | 6 ++---- cypress/integration/item/edit/editFile.spec.js | 6 ++---- cypress/integration/item/edit/editFolder.spec.js | 6 ++---- cypress/integration/item/edit/editLink.spec.js | 6 ++---- cypress/integration/item/edit/editShortcut.spec.js | 6 ++---- cypress/integration/item/edit/utils.js | 7 ++----- cypress/integration/item/move/gridMoveItem.spec.js | 3 ++- cypress/integration/item/move/listMoveItem.spec.js | 2 +- cypress/integration/item/share/gridShareItem.spec.js | 2 +- cypress/integration/item/share/listShareItem.spec.js | 4 ++-- cypress/integration/item/upload/gridItemUpload.spec.js | 6 ++---- cypress/integration/item/upload/listItemUpload.spec.js | 6 ++---- cypress/integration/item/view/viewFile.spec.js | 6 ++---- cypress/integration/item/view/viewFolder.spec.js | 6 ++---- cypress/support/commands.js | 2 +- src/config/enum/mimeTypes.js | 10 ++++++++++ 34 files changed, 67 insertions(+), 97 deletions(-) create mode 100644 src/config/enum/mimeTypes.js diff --git a/cypress/fixtures/apps.js b/cypress/fixtures/apps.js index ce4b1c122..123aa58ff 100644 --- a/cypress/fixtures/apps.js +++ b/cypress/fixtures/apps.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES } from '../../src/config/constants'; +import { ITEM_TYPES } from '../../src/config/enum'; import { DEFAULT_FOLDER_ITEM } from './items'; import { CURRENT_USER } from './members'; diff --git a/cypress/fixtures/documents.js b/cypress/fixtures/documents.js index eeff1a308..1fca77c65 100644 --- a/cypress/fixtures/documents.js +++ b/cypress/fixtures/documents.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES } from '../../src/config/constants'; +import { ITEM_TYPES } from '../../src/config/enum'; import { buildDocumentExtra } from '../../src/utils/itemExtra'; import { CURRENT_USER } from './members'; import { DEFAULT_FOLDER_ITEM } from './items'; diff --git a/cypress/fixtures/files.js b/cypress/fixtures/files.js index abfc90dc2..ccb7d6586 100644 --- a/cypress/fixtures/files.js +++ b/cypress/fixtures/files.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES, MIME_TYPES } from '../../src/config/constants'; +import { ITEM_TYPES, MIME_TYPES } from '../../src/config/enum'; import { buildFileExtra, buildS3FileExtra } from '../../src/utils/itemExtra'; export const ICON_FILEPATH = 'files/icon.png'; diff --git a/cypress/fixtures/items.js b/cypress/fixtures/items.js index 93bc894fb..f3cdd218e 100644 --- a/cypress/fixtures/items.js +++ b/cypress/fixtures/items.js @@ -1,8 +1,5 @@ -import { - ITEM_TYPES, - PERMISSION_LEVELS, - SETTINGS, -} from '../../src/config/constants'; +import { SETTINGS } from '../../src/config/constants'; +import { ITEM_TYPES, PERMISSION_LEVELS } from '../../src/config/enum'; import { buildItemLoginSchemaExtra } from '../../src/utils/itemExtra'; import { CURRENT_USER, MEMBERS } from './members'; import { DEFAULT_TAGS, ITEM_LOGIN_TAG } from './itemTags'; diff --git a/cypress/fixtures/links.js b/cypress/fixtures/links.js index 236b31884..c40a25240 100644 --- a/cypress/fixtures/links.js +++ b/cypress/fixtures/links.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES } from '../../src/config/constants'; +import { ITEM_TYPES } from '../../src/config/enum'; import { CURRENT_USER } from './members'; import { buildEmbeddedLinkExtra } from '../../src/utils/itemExtra'; diff --git a/cypress/integration/item/copy/gridCopyItem.spec.js b/cypress/integration/item/copy/gridCopyItem.spec.js index 26f188158..288b3aa13 100644 --- a/cypress/integration/item/copy/gridCopyItem.spec.js +++ b/cypress/integration/item/copy/gridCopyItem.spec.js @@ -1,4 +1,5 @@ -import { ITEM_LAYOUT_MODES, ROOT_ID } from '../../../../src/config/constants'; +import { ROOT_ID } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/integration/item/copy/listCopyItem.spec.js b/cypress/integration/item/copy/listCopyItem.spec.js index 90b6d69d1..080eab606 100644 --- a/cypress/integration/item/copy/listCopyItem.spec.js +++ b/cypress/integration/item/copy/listCopyItem.spec.js @@ -1,8 +1,9 @@ import { DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, ROOT_ID, } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; + import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId, diff --git a/cypress/integration/item/create/createApp.spec.js b/cypress/integration/item/create/createApp.spec.js index d2d78571a..db8e9a810 100644 --- a/cypress/integration/item/create/createApp.spec.js +++ b/cypress/integration/item/create/createApp.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { GRAASP_APP_ITEM } from '../../../fixtures/apps'; import { SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/create/createDocument.spec.js b/cypress/integration/item/create/createDocument.spec.js index 14092961d..fa672cd2f 100644 --- a/cypress/integration/item/create/createDocument.spec.js +++ b/cypress/integration/item/create/createDocument.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { GRAASP_DOCUMENT_ITEM } from '../../../fixtures/documents'; import { SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/create/createFile.spec.js b/cypress/integration/item/create/createFile.spec.js index 3908809c7..a70341b2d 100644 --- a/cypress/integration/item/create/createFile.spec.js +++ b/cypress/integration/item/create/createFile.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { IMAGE_ITEM_DEFAULT, IMAGE_ITEM_S3 } from '../../../fixtures/files'; import { SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/create/createFolder.spec.js b/cypress/integration/item/create/createFolder.spec.js index 0df803f05..81c749de6 100644 --- a/cypress/integration/item/create/createFolder.spec.js +++ b/cypress/integration/item/create/createFolder.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId } from '../../../../src/config/selectors'; import { CREATED_ITEM, SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/create/createLink.spec.js b/cypress/integration/item/create/createLink.spec.js index 5e6e0ff64..740260d3b 100644 --- a/cypress/integration/item/create/createLink.spec.js +++ b/cypress/integration/item/create/createLink.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { ITEM_FORM_CONFIRM_BUTTON_ID } from '../../../../src/config/selectors'; import { SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/create/createShortcut.spec.js b/cypress/integration/item/create/createShortcut.spec.js index 6f99d532d..bf5f8ff48 100644 --- a/cypress/integration/item/create/createShortcut.spec.js +++ b/cypress/integration/item/create/createShortcut.spec.js @@ -1,9 +1,6 @@ import qs from 'querystring'; -import { - ITEM_LAYOUT_MODES, - ITEM_TYPES, - ROOT_ID, -} from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES, ITEM_TYPES } from '../../../../src/config/enum'; +import { ROOT_ID } from '../../../../src/config/constants'; import { HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/integration/item/create/utils.js b/cypress/integration/item/create/utils.js index 410349694..da1d95f32 100644 --- a/cypress/integration/item/create/utils.js +++ b/cypress/integration/item/create/utils.js @@ -1,4 +1,4 @@ -import { ITEM_TYPES } from '../../../../src/config/constants'; +import { ITEM_TYPES } from '../../../../src/config/enum'; import { CREATE_ITEM_APP_ID, CREATE_ITEM_BUTTON_ID, diff --git a/cypress/integration/item/delete/gridDeleteItem.spec.js b/cypress/integration/item/delete/gridDeleteItem.spec.js index 2bf50215b..67bdbef3f 100644 --- a/cypress/integration/item/delete/gridDeleteItem.spec.js +++ b/cypress/integration/item/delete/gridDeleteItem.spec.js @@ -1,4 +1,4 @@ -import { ITEM_LAYOUT_MODES } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/integration/item/delete/listDeleteItem.spec.js b/cypress/integration/item/delete/listDeleteItem.spec.js index afea6e331..fca78d42a 100644 --- a/cypress/integration/item/delete/listDeleteItem.spec.js +++ b/cypress/integration/item/delete/listDeleteItem.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId, diff --git a/cypress/integration/item/delete/listDeleteItems.spec.js b/cypress/integration/item/delete/listDeleteItems.spec.js index fca152bc4..7be290b00 100644 --- a/cypress/integration/item/delete/listDeleteItems.spec.js +++ b/cypress/integration/item/delete/listDeleteItems.spec.js @@ -1,7 +1,5 @@ -import { - ITEM_LAYOUT_MODES, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId, diff --git a/cypress/integration/item/edit/editApp.spec.js b/cypress/integration/item/edit/editApp.spec.js index e0afd022b..dad73eb20 100644 --- a/cypress/integration/item/edit/editApp.spec.js +++ b/cypress/integration/item/edit/editApp.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildAppExtra } from '../../../../src/utils/itemExtra'; import { diff --git a/cypress/integration/item/edit/editDocument.spec.js b/cypress/integration/item/edit/editDocument.spec.js index 5a70c69d6..1d27506f4 100644 --- a/cypress/integration/item/edit/editDocument.spec.js +++ b/cypress/integration/item/edit/editDocument.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildDocumentExtra, diff --git a/cypress/integration/item/edit/editFile.spec.js b/cypress/integration/item/edit/editFile.spec.js index da6e4ecd4..7b1d30718 100644 --- a/cypress/integration/item/edit/editFile.spec.js +++ b/cypress/integration/item/edit/editFile.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { HOME_PATH } from '../../../../src/config/paths'; import { IMAGE_ITEM_DEFAULT, VIDEO_ITEM_S3 } from '../../../fixtures/files'; import { EDITED_FIELDS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/edit/editFolder.spec.js b/cypress/integration/item/edit/editFolder.spec.js index c26e270be..f95d1d0c1 100644 --- a/cypress/integration/item/edit/editFolder.spec.js +++ b/cypress/integration/item/edit/editFolder.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { EDITED_FIELDS, SAMPLE_ITEMS } from '../../../fixtures/items'; import { EDIT_ITEM_PAUSE } from '../../../support/constants'; diff --git a/cypress/integration/item/edit/editLink.spec.js b/cypress/integration/item/edit/editLink.spec.js index bb6033f52..80279d170 100644 --- a/cypress/integration/item/edit/editLink.spec.js +++ b/cypress/integration/item/edit/editLink.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { HOME_PATH } from '../../../../src/config/paths'; import { EDITED_FIELDS } from '../../../fixtures/items'; import { GRAASP_LINK_ITEM, YOUTUBE_LINK_ITEM } from '../../../fixtures/links'; diff --git a/cypress/integration/item/edit/editShortcut.spec.js b/cypress/integration/item/edit/editShortcut.spec.js index 0b0d19b45..101c0370c 100644 --- a/cypress/integration/item/edit/editShortcut.spec.js +++ b/cypress/integration/item/edit/editShortcut.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { HOME_PATH } from '../../../../src/config/paths'; import { EDITED_FIELDS, SHORTCUT } from '../../../fixtures/items'; import { GRAASP_LINK_ITEM, YOUTUBE_LINK_ITEM } from '../../../fixtures/links'; diff --git a/cypress/integration/item/edit/utils.js b/cypress/integration/item/edit/utils.js index 202b8428a..5a2213038 100644 --- a/cypress/integration/item/edit/utils.js +++ b/cypress/integration/item/edit/utils.js @@ -1,8 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_TYPES, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { ITEM_TYPES, ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; import { buildItemCard, buildItemsTableRowId, diff --git a/cypress/integration/item/move/gridMoveItem.spec.js b/cypress/integration/item/move/gridMoveItem.spec.js index a4c620af0..e391fd218 100644 --- a/cypress/integration/item/move/gridMoveItem.spec.js +++ b/cypress/integration/item/move/gridMoveItem.spec.js @@ -1,4 +1,5 @@ -import { ITEM_LAYOUT_MODES, ROOT_ID } from '../../../../src/config/constants'; +import { ROOT_ID } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/integration/item/move/listMoveItem.spec.js b/cypress/integration/item/move/listMoveItem.spec.js index 596798909..9a8501443 100644 --- a/cypress/integration/item/move/listMoveItem.spec.js +++ b/cypress/integration/item/move/listMoveItem.spec.js @@ -1,8 +1,8 @@ import { - ITEM_LAYOUT_MODES, ROOT_ID, DEFAULT_ITEM_LAYOUT_MODE, } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId, diff --git a/cypress/integration/item/share/gridShareItem.spec.js b/cypress/integration/item/share/gridShareItem.spec.js index 8c2a66dd3..5f8fab9cb 100644 --- a/cypress/integration/item/share/gridShareItem.spec.js +++ b/cypress/integration/item/share/gridShareItem.spec.js @@ -1,7 +1,7 @@ import { ITEM_LAYOUT_MODES, PERMISSION_LEVELS, -} from '../../../../src/config/constants'; +} from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/integration/item/share/listShareItem.spec.js b/cypress/integration/item/share/listShareItem.spec.js index 937929539..027f3ef06 100644 --- a/cypress/integration/item/share/listShareItem.spec.js +++ b/cypress/integration/item/share/listShareItem.spec.js @@ -1,8 +1,8 @@ import { ITEM_LAYOUT_MODES, PERMISSION_LEVELS, - DEFAULT_ITEM_LAYOUT_MODE, -} from '../../../../src/config/constants'; +} from '../../../../src/config/enum'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId, diff --git a/cypress/integration/item/upload/gridItemUpload.spec.js b/cypress/integration/item/upload/gridItemUpload.spec.js index e76f13fc5..6ed2a6a0c 100644 --- a/cypress/integration/item/upload/gridItemUpload.spec.js +++ b/cypress/integration/item/upload/gridItemUpload.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { UPLOADER_ID } from '../../../../src/config/selectors'; import { SAMPLE_ITEMS } from '../../../fixtures/items'; diff --git a/cypress/integration/item/upload/listItemUpload.spec.js b/cypress/integration/item/upload/listItemUpload.spec.js index 914dc95f3..83f470caf 100644 --- a/cypress/integration/item/upload/listItemUpload.spec.js +++ b/cypress/integration/item/upload/listItemUpload.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { UPLOADER_ID } from '../../../../src/config/selectors'; import { ICON_FILEPATH, TEXT_FILEPATH } from '../../../fixtures/files'; diff --git a/cypress/integration/item/view/viewFile.spec.js b/cypress/integration/item/view/viewFile.spec.js index 7d95742de..5632c4423 100644 --- a/cypress/integration/item/view/viewFile.spec.js +++ b/cypress/integration/item/view/viewFile.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { HOME_PATH } from '../../../../src/config/paths'; import { buildItemsTableRowId } from '../../../../src/config/selectors'; import { diff --git a/cypress/integration/item/view/viewFolder.spec.js b/cypress/integration/item/view/viewFolder.spec.js index c0e588593..ffac4cbd4 100644 --- a/cypress/integration/item/view/viewFolder.spec.js +++ b/cypress/integration/item/view/viewFolder.spec.js @@ -1,7 +1,5 @@ -import { - DEFAULT_ITEM_LAYOUT_MODE, - ITEM_LAYOUT_MODES, -} from '../../../../src/config/constants'; +import { DEFAULT_ITEM_LAYOUT_MODE } from '../../../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../../../src/config/enum'; import { buildItemPath, HOME_PATH } from '../../../../src/config/paths'; import { buildItemCard, diff --git a/cypress/support/commands.js b/cypress/support/commands.js index f30839f03..1f5d1bc8c 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,6 +1,6 @@ // eslint-disable-next-line import/no-extraneous-dependencies import 'cypress-file-upload'; -import { ITEM_LAYOUT_MODES } from '../../src/config/constants'; +import { ITEM_LAYOUT_MODES } from '../../src/config/enum'; import { MODE_GRID_BUTTON_ID, MODE_LIST_BUTTON_ID, diff --git a/src/config/enum/mimeTypes.js b/src/config/enum/mimeTypes.js new file mode 100644 index 000000000..0de18bc4b --- /dev/null +++ b/src/config/enum/mimeTypes.js @@ -0,0 +1,10 @@ +const MIME_TYPES = { + IMAGE: ['image/png', 'image/jpg', 'image/gif', 'image/jpeg'], + VIDEO: ['video/mp4'], + AUDIO: ['audio/mpeg', 'audio/mp3'], + PDF: ['application/pdf'], +}; + +Object.freeze(MIME_TYPES); + +export default MIME_TYPES;