Skip to content

Commit

Permalink
Cleanup TS in home plugin (#94516)
Browse files Browse the repository at this point in the history
* fix problem with home plugin

* home: /mocks/index.ts --> mocks

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
mshustov and kibanamachine authored Mar 12, 2021
1 parent ef042b9 commit 0c3514c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import React from 'react';
import { AddData } from './add_data';
import { shallowWithIntl } from '@kbn/test/jest';
import { FeatureCatalogueEntry, FeatureCatalogueCategory } from '../../../services';

jest.mock('../app_navigation_handler', () => {
return {
Expand All @@ -28,9 +29,9 @@ beforeEach(() => {

const addBasePathMock = jest.fn((path: string) => (path ? path : 'path'));

const mockFeatures = [
const mockFeatures: FeatureCatalogueEntry[] = [
{
category: 'data',
category: FeatureCatalogueCategory.DATA,
description: 'Ingest data from popular apps and services.',
showOnHomePage: true,
icon: 'indexOpen',
Expand All @@ -40,7 +41,7 @@ const mockFeatures = [
title: 'Ingest data',
},
{
category: 'admin',
category: FeatureCatalogueCategory.ADMIN,
description: 'Add and manage your fleet of Elastic Agents and integrations.',
showOnHomePage: true,
icon: 'indexManagementApp',
Expand All @@ -50,7 +51,7 @@ const mockFeatures = [
title: 'Add Elastic Agent',
},
{
category: 'data',
category: FeatureCatalogueCategory.DATA,
description: 'Import your own CSV, NDJSON, or log file',
showOnHomePage: true,
icon: 'document',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import PropTypes from 'prop-types';
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { METRIC_TYPE } from '@kbn/analytics';
// @ts-expect-error untyped service
import { FeatureCatalogueEntry } from '../../services';
import type { FeatureCatalogueEntry } from '../../../services';
import { createAppNavigationHandler } from '../app_navigation_handler';
// @ts-expect-error untyped component
import { Synopsis } from '../synopsis';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import React from 'react';
import { ManageData } from './manage_data';
import { shallowWithIntl } from '@kbn/test/jest';
import { FeatureCatalogueEntry, FeatureCatalogueCategory } from '../../../services';

jest.mock('../app_navigation_handler', () => {
return {
Expand All @@ -28,9 +29,9 @@ beforeEach(() => {

const addBasePathMock = jest.fn((path: string) => (path ? path : 'path'));

const mockFeatures = [
const mockFeatures: FeatureCatalogueEntry[] = [
{
category: 'admin',
category: FeatureCatalogueCategory.ADMIN,
description: 'Control who has access and what tasks they can perform.',
icon: 'securityApp',
id: 'security',
Expand All @@ -40,7 +41,7 @@ const mockFeatures = [
showOnHomePage: true,
},
{
category: 'admin',
category: FeatureCatalogueCategory.ADMIN,
description: 'Track the real-time health and performance of your deployment.',
icon: 'monitoringApp',
id: 'monitoring',
Expand All @@ -50,7 +51,7 @@ const mockFeatures = [
showOnHomePage: true,
},
{
category: 'admin',
category: FeatureCatalogueCategory.ADMIN,
description:
'Save snapshots to a backup repository, and restore to recover index and cluster state.',
icon: 'storage',
Expand All @@ -61,7 +62,7 @@ const mockFeatures = [
showOnHomePage: true,
},
{
category: 'admin',
category: FeatureCatalogueCategory.ADMIN,
description: 'Define lifecycle policies to automatically perform operations as an index ages.',
icon: 'indexSettings',
id: 'index_lifecycle_management',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import PropTypes from 'prop-types';
import { EuiFlexGroup, EuiHorizontalRule, EuiSpacer, EuiTitle, EuiFlexItem } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { METRIC_TYPE } from '@kbn/analytics';
// @ts-expect-error untyped service
import { FeatureCatalogueEntry } from '../../services';
import { FeatureCatalogueEntry } from '../../../services';
import { createAppNavigationHandler } from '../app_navigation_handler';
// @ts-expect-error untyped component
import { Synopsis } from '../synopsis';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Side Public License, v 1.
*/

import { featureCatalogueRegistryMock } from '../services/feature_catalogue/feature_catalogue_registry.mock';
import { environmentServiceMock } from '../services/environment/environment.mock';
import { configSchema } from '../../config';
import { tutorialServiceMock } from '../services/tutorials/tutorial_service.mock';
import { featureCatalogueRegistryMock } from './services/feature_catalogue/feature_catalogue_registry.mock';
import { environmentServiceMock } from './services/environment/environment.mock';
import { configSchema } from '../config';
import { tutorialServiceMock } from './services/tutorials/tutorial_service.mock';

const createSetupContract = () => ({
featureCatalogue: featureCatalogueRegistryMock.createSetup(),
Expand Down

0 comments on commit 0c3514c

Please sign in to comment.