[Enterprise Search] Fix eslint import rule not ordering sibling mocks with parent mocks (#96070)

* Enterprise Search eslint import order rule fix
- mocks in current folder should be grouped with mocks from parent folders

* Run --fix/update instances of importing ./__mocks__
This commit is contained in:
Constance 2021-04-02 06:05:53 -07:00 committed by GitHub
parent f042ec8945
commit 3237fd0637
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 16 additions and 20 deletions

View file

@ -1180,7 +1180,7 @@ module.exports = {
pathGroups: [
{
pattern:
'{../../../../../../,../../../../../,../../../../,../../../,../../,../}{common/,*}__mocks__{*,/**}',
'{../../../../../../,../../../../../,../../../../,../../../,../../,../,./}{common/,*}__mocks__{*,/**}',
group: 'unknown',
},
{

View file

@ -6,6 +6,7 @@
*/
import { setMockValues } from '../../../../__mocks__/kea.mock';
import { setMockSearchContextState } from './__mocks__/hooks.mock';
import React from 'react';
@ -16,7 +17,6 @@ import { Results } from '@elastic/react-search-ui';
import { SchemaTypes } from '../../../../shared/types';
import { setMockSearchContextState } from './__mocks__/hooks.mock';
import { Pagination } from './pagination';
import { SearchExperienceContent } from './search_experience_content';
import { ResultView } from './views';

View file

@ -5,14 +5,14 @@
* 2.0.
*/
import { wsRoleMapping, asRoleMapping } from './__mocks__/roles';
import React from 'react';
import { shallow } from 'enzyme';
import { EuiFieldSearch, EuiTableRow } from '@elastic/eui';
import { wsRoleMapping, asRoleMapping } from './__mocks__/roles';
import { ALL_LABEL, ANY_AUTH_PROVIDER_OPTION_LABEL } from './constants';
import { RoleMappingsTable } from './role_mappings_table';

View file

@ -12,12 +12,12 @@ import {
mockHttpValues,
} from '../../../__mocks__';
import { groups } from '../../__mocks__/groups.mock';
import { mockGroupValues } from './__mocks__/group_logic.mock';
import { nextTick } from '@kbn/test/jest';
import { GROUPS_PATH } from '../../routes';
import { mockGroupValues } from './__mocks__/group_logic.mock';
import { GroupLogic } from './group_logic';
describe('GroupLogic', () => {

View file

@ -9,13 +9,13 @@ import { LogicMounter, mockFlashMessageHelpers, mockHttpValues } from '../../../
import { contentSources } from '../../__mocks__/content_sources.mock';
import { groups } from '../../__mocks__/groups.mock';
import { users } from '../../__mocks__/users.mock';
import { mockGroupsValues } from './__mocks__/groups_logic.mock';
import { nextTick } from '@kbn/test/jest';
import { JSON_HEADER as headers } from '../../../../../common/constants';
import { DEFAULT_META } from '../../../shared/constants';
import { mockGroupsValues } from './__mocks__/groups_logic.mock';
import { GroupsLogic } from './groups_logic';
// We need to mock out the debounced functionality

View file

@ -6,7 +6,7 @@
*/
import { mockTelemetryActions } from '../../../__mocks__';
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -15,7 +15,6 @@ import { shallow } from 'enzyme';
import { SOURCES_PATH, USERS_PATH } from '../../routes';
import { setMockValues } from './__mocks__';
import { OnboardingCard } from './onboarding_card';
import { OnboardingSteps, OrgNameOnboarding } from './onboarding_steps';

View file

@ -5,6 +5,7 @@
* 2.0.
*/
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -13,7 +14,6 @@ import { shallow } from 'enzyme';
import { EuiFlexGrid } from '@elastic/eui';
import { setMockValues } from './__mocks__';
import { OrganizationStats } from './organization_stats';
import { StatisticCard } from './statistic_card';

View file

@ -7,6 +7,7 @@
import '../../../__mocks__/react_router_history.mock';
import './__mocks__/overview_logic.mock';
import { mockActions, setMockValues } from './__mocks__';
import React from 'react';
@ -15,7 +16,6 @@ import { shallow, mount } from 'enzyme';
import { Loading } from '../../../shared/loading';
import { ViewContentHeader } from '../../components/shared/view_content_header';
import { mockActions, setMockValues } from './__mocks__';
import { OnboardingSteps } from './onboarding_steps';
import { OrganizationStats } from './organization_stats';
import { Overview } from './overview';

View file

@ -6,8 +6,8 @@
*/
import { LogicMounter, mockHttpValues } from '../../../__mocks__';
import { mockOverviewValues } from './__mocks__';
import { OverviewLogic } from './overview_logic';
describe('OverviewLogic', () => {

View file

@ -6,7 +6,7 @@
*/
import { mockTelemetryActions } from '../../../__mocks__';
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -18,7 +18,6 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { EuiLinkTo } from '../../../shared/react_router_helpers';
import { setMockValues } from './__mocks__';
import { RecentActivity, RecentActivityItem } from './recent_activity';
const organization = { name: 'foo', defaultOrgName: 'bar' };

View file

@ -6,7 +6,7 @@
*/
import { mockTelemetryActions } from '../../../__mocks__';
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -15,7 +15,6 @@ import { shallow } from 'enzyme';
import { SOURCES_PATH, USERS_PATH } from '../../routes';
import { setMockValues } from './__mocks__';
import { OnboardingCard } from './onboarding_card';
import { OnboardingSteps, OrgNameOnboarding } from './onboarding_steps';

View file

@ -5,6 +5,7 @@
* 2.0.
*/
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -13,7 +14,6 @@ import { shallow } from 'enzyme';
import { EuiFlexGrid } from '@elastic/eui';
import { setMockValues } from './__mocks__';
import { OrganizationStats } from './organization_stats';
import { StatisticCard } from './statistic_card';

View file

@ -7,6 +7,7 @@
import '../../../__mocks__/react_router_history.mock';
import './__mocks__/overview_logic.mock';
import { mockActions, setMockValues } from './__mocks__';
import React from 'react';
@ -15,7 +16,6 @@ import { shallow, mount } from 'enzyme';
import { Loading } from '../../../shared/loading';
import { ViewContentHeader } from '../../components/shared/view_content_header';
import { mockActions, setMockValues } from './__mocks__';
import { OnboardingSteps } from './onboarding_steps';
import { OrganizationStats } from './organization_stats';
import { Overview } from './overview';

View file

@ -6,8 +6,8 @@
*/
import { LogicMounter, mockHttpValues } from '../../../__mocks__';
import { mockOverviewValues } from './__mocks__';
import { OverviewLogic } from './overview_logic';
describe('OverviewLogic', () => {

View file

@ -6,7 +6,7 @@
*/
import { mockTelemetryActions } from '../../../__mocks__';
import { setMockValues } from './__mocks__';
import './__mocks__/overview_logic.mock';
import React from 'react';
@ -16,7 +16,6 @@ import { shallow } from 'enzyme';
import { EuiEmptyPrompt, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { setMockValues } from './__mocks__';
import { RecentActivity, RecentActivityItem } from './recent_activity';
const organization = { name: 'foo', defaultOrgName: 'bar' };