From 00dd09ec8157a2e9bcaef97af13e14cd20dc1640 Mon Sep 17 00:00:00 2001 From: PolariTOON <36267812+PolariTOON@users.noreply.github.com> Date: Thu, 2 Feb 2023 10:50:51 +0100 Subject: [PATCH] feat: Use bare directories instead of index files in specifiers --- react/ActionMenu/index.spec.jsx | 2 +- react/Alerter/alerter.spec.js | 2 +- react/AppIcon/test/AppIcon.spec.js | 2 +- react/AppLinker/index.deprecated.spec.jsx | 2 +- react/AppLinker/index.spec.jsx | 2 +- react/AppTile/AppTile.spec.jsx | 2 +- react/Banner/index.spec.jsx | 2 +- react/CipherIcon/index.spec.jsx | 2 +- react/DateMonthPicker/index.spec.jsx | 2 +- react/Field/index.spec.js | 2 +- react/FileInput/index.spec.jsx | 2 +- react/FilePicker/FilePickerHeader.jsx | 2 +- react/I18n/withLocales.jsx | 2 +- react/Input/index.spec.jsx | 2 +- react/Modal/index.spec.jsx | 2 +- react/PieChart/index.spec.jsx | 2 +- react/Popup/index.spec.jsx | 2 +- react/PushClientButton/index.spec.jsx | 2 +- react/Radio/index.spec.jsx | 2 +- react/SquareAppIcon/SquareAppIcon.spec.js | 2 +- react/UploadQueue/index.spec.jsx | 2 +- react/ViewStack/example.jsx | 2 +- react/ViewStack/index.spec.jsx | 2 +- react/Viewer/Viewer.jsx | 2 +- react/Viewer/ViewerExposer.js | 2 +- react/Viewer/components/ViewerControls.jsx | 2 +- react/hooks/useConfirmExit/index.spec.js | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/react/ActionMenu/index.spec.jsx b/react/ActionMenu/index.spec.jsx index 69d2c41cde..3037aec517 100644 --- a/react/ActionMenu/index.spec.jsx +++ b/react/ActionMenu/index.spec.jsx @@ -10,7 +10,7 @@ import Icon from '../Icon' import FileIcon from '../Icons/File' import WarningIcon from '../Icons/Warning' -import ActionMenu, { ActionMenuItem, ActionMenuRadio } from './' +import ActionMenu, { ActionMenuItem, ActionMenuRadio } from '.' describe('ActionMenu', () => { fixPopperTesting() diff --git a/react/Alerter/alerter.spec.js b/react/Alerter/alerter.spec.js index ca24335887..ac7611bc19 100644 --- a/react/Alerter/alerter.spec.js +++ b/react/Alerter/alerter.spec.js @@ -4,7 +4,7 @@ import React from 'react' import { shallow } from 'enzyme' -import Alerter from './' +import Alerter from '.' import Alert from './Alert' import Button from '../Button' diff --git a/react/AppIcon/test/AppIcon.spec.js b/react/AppIcon/test/AppIcon.spec.js index 2d2fe097e2..e96b415a81 100644 --- a/react/AppIcon/test/AppIcon.spec.js +++ b/react/AppIcon/test/AppIcon.spec.js @@ -4,7 +4,7 @@ import React from 'react' import { shallow } from 'enzyme' -import { AppIcon } from '../' +import { AppIcon } from '..' describe('AppIcon component', () => { const app = {} diff --git a/react/AppLinker/index.deprecated.spec.jsx b/react/AppLinker/index.deprecated.spec.jsx index 1fcaf8a201..41758dbd7e 100644 --- a/react/AppLinker/index.deprecated.spec.jsx +++ b/react/AppLinker/index.deprecated.spec.jsx @@ -19,7 +19,7 @@ import { checkApp } from 'cozy-device-helper' -import AppLinker from './index' +import AppLinker from '.' import { generateUniversalLink } from './native' jest.useFakeTimers() diff --git a/react/AppLinker/index.spec.jsx b/react/AppLinker/index.spec.jsx index 9b8914cb53..8d888b326b 100644 --- a/react/AppLinker/index.spec.jsx +++ b/react/AppLinker/index.spec.jsx @@ -11,7 +11,7 @@ import { checkApp } from 'cozy-device-helper' -import AppLinker from './index' +import AppLinker from '.' import { generateUniversalLink } from './native' jest.useFakeTimers() diff --git a/react/AppTile/AppTile.spec.jsx b/react/AppTile/AppTile.spec.jsx index 2dcf528ec6..6671b820eb 100644 --- a/react/AppTile/AppTile.spec.jsx +++ b/react/AppTile/AppTile.spec.jsx @@ -9,7 +9,7 @@ import CozyClient, { CozyProvider } from 'cozy-client' import en from '../AppSections/locales/en.json' import I18n from '../I18n' -import AppTile from './index' +import AppTile from '.' const appMock = { slug: 'test', diff --git a/react/Banner/index.spec.jsx b/react/Banner/index.spec.jsx index 282b776834..9e7cd97b12 100644 --- a/react/Banner/index.spec.jsx +++ b/react/Banner/index.spec.jsx @@ -1,6 +1,6 @@ import React from 'react' import { render } from '@testing-library/react' -import Banner from './index' +import Banner from '.' describe('Grid', () => { it('should render correctly justify content', () => { diff --git a/react/CipherIcon/index.spec.jsx b/react/CipherIcon/index.spec.jsx index 0f32d2807f..33f1a8d276 100644 --- a/react/CipherIcon/index.spec.jsx +++ b/react/CipherIcon/index.spec.jsx @@ -1,6 +1,6 @@ import React from 'react' import { fireEvent, render } from '@testing-library/react' -import CipherIcon from './index' +import CipherIcon from '.' jest.mock('cozy-client', () => ({ withClient: Component => { diff --git a/react/DateMonthPicker/index.spec.jsx b/react/DateMonthPicker/index.spec.jsx index ef8273ce58..948eb0d670 100644 --- a/react/DateMonthPicker/index.spec.jsx +++ b/react/DateMonthPicker/index.spec.jsx @@ -1,6 +1,6 @@ import { mount } from 'enzyme' import React from 'react' -import DateMonthPicker from './index' +import DateMonthPicker from '.' import { act } from 'react-dom/test-utils' import I18n from '../I18n' diff --git a/react/Field/index.spec.js b/react/Field/index.spec.js index bb2e215235..1af878e36c 100644 --- a/react/Field/index.spec.js +++ b/react/Field/index.spec.js @@ -1,5 +1,5 @@ import React from 'react' -import Field from './' +import Field from '.' import { shallow } from 'enzyme' describe('Field component', () => { diff --git a/react/FileInput/index.spec.jsx b/react/FileInput/index.spec.jsx index f99d749afa..2f00562af4 100644 --- a/react/FileInput/index.spec.jsx +++ b/react/FileInput/index.spec.jsx @@ -1,7 +1,7 @@ import React from 'react' import uniqueId from 'lodash/uniqueId' -import FileInput from './index' +import FileInput from '.' jest.mock('lodash/uniqueId') diff --git a/react/FilePicker/FilePickerHeader.jsx b/react/FilePicker/FilePickerHeader.jsx index da923892cd..57165e9370 100644 --- a/react/FilePicker/FilePickerHeader.jsx +++ b/react/FilePicker/FilePickerHeader.jsx @@ -12,7 +12,7 @@ import Previous from '../Icons/Previous' import FilePickerBreadcrumb from './FilePickerBreadcrumb' import { buildCurrentFolderQuery } from './queries' -import { ROOT_DIR_ID } from './index' +import { ROOT_DIR_ID } from '.' /** * @param {IOCozyFolder} displayedFolder - An io.cozy.files folder diff --git a/react/I18n/withLocales.jsx b/react/I18n/withLocales.jsx index 790b11c27b..2a0eed8cd6 100644 --- a/react/I18n/withLocales.jsx +++ b/react/I18n/withLocales.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { I18n, translate } from './' +import { I18n, translate } from '.' import omit from 'lodash/omit' /** diff --git a/react/Input/index.spec.jsx b/react/Input/index.spec.jsx index f81e024c00..423f9eaf7e 100644 --- a/react/Input/index.spec.jsx +++ b/react/Input/index.spec.jsx @@ -1,6 +1,6 @@ import React from 'react' -import Input from './index' +import Input from '.' describe('Input component', () => { it('should support number type', () => { diff --git a/react/Modal/index.spec.jsx b/react/Modal/index.spec.jsx index daa180eca6..820d25e0bd 100644 --- a/react/Modal/index.spec.jsx +++ b/react/Modal/index.spec.jsx @@ -2,7 +2,7 @@ import React from 'react' import { act } from 'react-dom/test-utils' import { useState } from 'react' import { mount } from 'enzyme' -import Modal, { BODY_CLASS } from './index' +import Modal, { BODY_CLASS } from '.' import { BreakpointsProvider } from '../hooks/useBreakpoints' describe('Modal', () => { diff --git a/react/PieChart/index.spec.jsx b/react/PieChart/index.spec.jsx index 4027b98cd8..d0ffb57854 100644 --- a/react/PieChart/index.spec.jsx +++ b/react/PieChart/index.spec.jsx @@ -1,4 +1,4 @@ -import { makeOptions, makeData } from './index' +import { makeOptions, makeData } from '.' describe('makeOptions', () => { it('should return default options', () => { diff --git a/react/Popup/index.spec.jsx b/react/Popup/index.spec.jsx index 890965337a..4f9f2b93e7 100644 --- a/react/Popup/index.spec.jsx +++ b/react/Popup/index.spec.jsx @@ -3,7 +3,7 @@ import { shallow } from 'enzyme' import { isMobileApp } from 'cozy-device-helper' -import { Popup } from './' +import { Popup } from '.' jest.mock('cozy-device-helper', () => ({ ...jest.requireActual('cozy-device-helper'), diff --git a/react/PushClientButton/index.spec.jsx b/react/PushClientButton/index.spec.jsx index deafed359d..0c46b5014d 100644 --- a/react/PushClientButton/index.spec.jsx +++ b/react/PushClientButton/index.spec.jsx @@ -2,7 +2,7 @@ import React from 'react' import { render } from '@testing-library/react' -import PushClientButton from './' +import PushClientButton from '.' jest.mock('../Icons/DeviceLaptop', () => () => (
diff --git a/react/Radio/index.spec.jsx b/react/Radio/index.spec.jsx index 48182045e8..5633844832 100644 --- a/react/Radio/index.spec.jsx +++ b/react/Radio/index.spec.jsx @@ -2,7 +2,7 @@ import React, { useState } from 'react' import { render, fireEvent } from '@testing-library/react' -import Radio from './' +import Radio from '.' import RadioGroup from '../RadioGroup' import FormControlLabel from '../FormControlLabel' diff --git a/react/SquareAppIcon/SquareAppIcon.spec.js b/react/SquareAppIcon/SquareAppIcon.spec.js index 13205aad08..7809ab09ed 100644 --- a/react/SquareAppIcon/SquareAppIcon.spec.js +++ b/react/SquareAppIcon/SquareAppIcon.spec.js @@ -8,7 +8,7 @@ import CozyClient, { CozyProvider } from 'cozy-client' import Icon from '../Icon' import CozyIcon from '../Icons/Cozy' import MuiCozyTheme from '../MuiCozyTheme' -import SquareAppIcon from './index' +import SquareAppIcon from '.' const appMock = { slug: 'test', diff --git a/react/UploadQueue/index.spec.jsx b/react/UploadQueue/index.spec.jsx index a400ee4451..01ec76d222 100644 --- a/react/UploadQueue/index.spec.jsx +++ b/react/UploadQueue/index.spec.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { UploadQueue, formatRemainingTime } from './index' +import { UploadQueue, formatRemainingTime } from '.' import { render } from '@testing-library/react' import { useI18n } from '../I18n' diff --git a/react/ViewStack/example.jsx b/react/ViewStack/example.jsx index 4087edbcb5..a807586711 100644 --- a/react/ViewStack/example.jsx +++ b/react/ViewStack/example.jsx @@ -1,5 +1,5 @@ import React from 'react' -import { useViewStack } from './index' +import { useViewStack } from '.' import Button from '../Button' const PaddedParagraph = ({ children }) => ( diff --git a/react/ViewStack/index.spec.jsx b/react/ViewStack/index.spec.jsx index aaa7302915..4c8a7d156d 100644 --- a/react/ViewStack/index.spec.jsx +++ b/react/ViewStack/index.spec.jsx @@ -2,7 +2,7 @@ import { mount } from 'enzyme' import React from 'react' import { act } from 'react-dom/test-utils' import { Slide } from './example' -import ViewStack from './index' +import ViewStack from '.' import Button from '../Button' import SwipeableViews from 'react-swipeable-views' diff --git a/react/Viewer/Viewer.jsx b/react/Viewer/Viewer.jsx index b6c11664bc..03d66952eb 100644 --- a/react/Viewer/Viewer.jsx +++ b/react/Viewer/Viewer.jsx @@ -5,7 +5,7 @@ import { FileDoctype } from '../proptypes' import ViewerControls from './components/ViewerControls' import ViewerByFile from './components/ViewerByFile' -import { toolbarPropsPropType } from './index' +import { toolbarPropsPropType } from '.' const KEY_CODE_LEFT = 37 const KEY_CODE_RIGHT = 39 diff --git a/react/Viewer/ViewerExposer.js b/react/Viewer/ViewerExposer.js index 3f768646a3..75b1b3f548 100644 --- a/react/Viewer/ViewerExposer.js +++ b/react/Viewer/ViewerExposer.js @@ -1,3 +1,3 @@ -import DefaultViewer from './index' +import DefaultViewer from '.' export default DefaultViewer diff --git a/react/Viewer/components/ViewerControls.jsx b/react/Viewer/components/ViewerControls.jsx index 9b5eb1931f..54c5d4f9c6 100644 --- a/react/Viewer/components/ViewerControls.jsx +++ b/react/Viewer/components/ViewerControls.jsx @@ -8,7 +8,7 @@ import { withStyles } from '../../styles' import withBreakpoints from '../../helpers/withBreakpoints' import { isValidForPanel } from '../helpers' -import { toolbarPropsPropType } from '../index' +import { toolbarPropsPropType } from '..' import { infoWidth } from './InformationPanel' import Toolbar from './Toolbar' import Navigation from './Navigation' diff --git a/react/hooks/useConfirmExit/index.spec.js b/react/hooks/useConfirmExit/index.spec.js index 0e32017032..ba2b0efd94 100644 --- a/react/hooks/useConfirmExit/index.spec.js +++ b/react/hooks/useConfirmExit/index.spec.js @@ -1,4 +1,4 @@ -import useConfirmExit from './' +import useConfirmExit from '.' import { renderHook, act } from '@testing-library/react-hooks' import { isElement } from 'react-dom/test-utils'