Skip to content

Commit

Permalink
fix: imports for constants inside the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HadiKhai committed Jun 2, 2021
1 parent fc81a87 commit f4c85d0
Show file tree
Hide file tree
Showing 34 changed files with 67 additions and 97 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/apps.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/documents.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/files.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 2 additions & 5 deletions cypress/fixtures/items.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/links.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/item/copy/gridCopyItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/item/copy/listCopyItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/create/createApp.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/create/createDocument.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/create/createFile.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/create/createFolder.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/create/createLink.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 2 additions & 5 deletions cypress/integration/item/create/createShortcut.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/item/create/utils.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/item/delete/gridDeleteItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/delete/listDeleteItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/delete/listDeleteItems.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editApp.spec.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editDocument.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editFile.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editFolder.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editLink.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/edit/editShortcut.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 2 additions & 5 deletions cypress/integration/item/edit/utils.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/item/move/gridMoveItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/item/move/listMoveItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/item/share/gridShareItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/item/share/listShareItem.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/upload/gridItemUpload.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/upload/listItemUpload.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/view/viewFile.spec.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions cypress/integration/item/view/viewFolder.spec.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
10 changes: 10 additions & 0 deletions src/config/enum/mimeTypes.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f4c85d0

Please sign in to comment.