Skip to content

Commit

Permalink
move shared resource test data to console-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-phillips-18 committed Nov 16, 2020
1 parent 462f3da commit 357fc55
Show file tree
Hide file tree
Showing 22 changed files with 3,385 additions and 3,395 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sampleDeployments } from '@console/dev-console/src/components/topology/__tests__/topology-test-data';
import { sampleDeployments } from '@console/shared/src/utils/__tests__/test-resource-data';
import { AddHealthChecks, EditHealthChecks } from '../modify-health-checks';
import { DeploymentModel } from '@console/internal/models';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { shallow } from 'enzyme';
import { Alert } from '@patternfly/react-core';
import * as utils from '@console/internal/components/utils';
import { sampleDeployments } from '@console/dev-console/src/components/topology/__tests__/topology-test-data';
import { sampleDeployments } from '@console/shared/src/utils/__tests__/test-resource-data';
import HealthChecksAlert from '../HealthChecksAlert';

jest.mock('react-i18next', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { shallow } from 'enzyme';
import { PodKind } from '@console/internal/module/k8s';
import { samplePods } from '@console/dev-console/src/components/topology/__tests__/topology-test-data';
import { samplePods } from '@console/shared/src/utils/__tests__/test-resource-data';
import { LongArrowAltRightIcon } from '@patternfly/react-icons';
import PodRingSet from '../PodRingSet';
import { PodRCData } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import * as React from 'react';
import { Button } from '@patternfly/react-core';
import { useExtensions, OverviewTabSection, LazyLoader } from '@console/plugin-sdk';
import { KnativeServiceOverviewItem } from '@console/knative-plugin/src/topology/topology-types';
import {
knativeServiceObj,
sampleKnativeRevisions,
} from '@console/knative-plugin/src/topology/__tests__/topology-knative-test-data';
import { OverviewItem } from '../../types/resource';
import { testHook } from '../../test-utils/hooks-utils';
import { usePluginsOverviewTabSection } from '../plugins-overview-tab-section';
import { sampleDeploymentConfigs } from '../../utils/__tests__/test-resource-data';

jest.mock('@console/plugin-sdk/src/api/useExtensions', () => ({
useExtensions: jest.fn(),
}));
describe('usePluginsOverviewTabSection', () => {
let item: KnativeServiceOverviewItem;
let item: OverviewItem;
beforeEach(() => {
item = {
revisions: sampleKnativeRevisions.data,
obj: knativeServiceObj,
buildConfigs: [],
routes: [],
services: [],
obj: sampleDeploymentConfigs.data[0],
deploymentConfigs: sampleDeploymentConfigs,
isMonitorable: true,
} as OverviewItem;
});

Expand All @@ -39,7 +33,7 @@ describe('usePluginsOverviewTabSection', () => {
const tabSection: OverviewTabSection = {
type: 'Overview/Section',
properties: {
key: 'revisions',
key: 'deploymentConfigs',
loader,
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as _ from 'lodash';
import {
MockResources,
sampleCronJobs,
sampleDaemonSets,
sampleDeploymentConfigs,
sampleDeployments,
sampleStatefulSets,
} from '@console/dev-console/src/components/topology/__tests__/topology-test-data';
MockResources,
} from '@console/shared/src/utils/__tests__/test-resource-data';
import {
getPodsForDeploymentConfig,
getPodsForDeployment,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import * as _ from 'lodash';
import { ResourceUtil } from '@console/shared';
import {
MockResources,
sampleDeploymentConfigs,
sampleDeployments,
} from '@console/dev-console/src/components/topology/__tests__/topology-test-data';
import { MockResources, sampleDeploymentConfigs, sampleDeployments } from './test-resource-data';
import {
getKnativeServingRevisions,
getKnativeServingConfigurations,
Expand Down

0 comments on commit 357fc55

Please sign in to comment.