Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename client integration test folders #100119

Merged
merged 5 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import sinon, { SinonFakeServer } from 'sinon';
import { API_BASE_PATH } from '../../common/constants';
import { UpgradeAssistantStatus } from '../../common/types';
import { ResponseError } from '../../public/application/lib/api';
import { API_BASE_PATH } from '../../../common/constants';
import { UpgradeAssistantStatus } from '../../../common/types';
import { ResponseError } from '../../../public/application/lib/api';

// Register helpers to mock HTTP Requests
const registerHttpRequestMockHelpers = (server: SinonFakeServer) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { EsDeprecationsContent } from '../../public/application/components/es_deprecations';
import { EsDeprecationsContent } from '../../../public/application/components/es_deprecations';
import { WithAppDependencies } from './setup_environment';

const testBedConfig: TestBedConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { KibanaDeprecationsContent } from '../../public/application/components/kibana_deprecations';
import { KibanaDeprecationsContent } from '../../../public/application/components/kibana_deprecations';
import { WithAppDependencies } from './setup_environment';

const testBedConfig: TestBedConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { act } from 'react-dom/test-utils';
import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { DeprecationsOverview } from '../../public/application/components/overview';
import { DeprecationsOverview } from '../../../public/application/components/overview';
import { WithAppDependencies } from './setup_environment';

const testBedConfig: TestBedConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
deprecationsServiceMock,
docLinksServiceMock,
notificationServiceMock,
} from '../../../../../src/core/public/mocks';
import { HttpSetup } from '../../../../../src/core/public';
} from 'src/core/public/mocks';
import { HttpSetup } from 'src/core/public';

import { mockKibanaSemverVersion, UA_READONLY_MODE } from '../../common/constants';
import { AppContextProvider } from '../../public/application/app_context';
import { mockKibanaSemverVersion, UA_READONLY_MODE } from '../../../common/constants';
import { AppContextProvider } from '../../../public/application/app_context';
import { apiService } from '../../../public/application/lib/api';
import { breadcrumbService } from '../../../public/application/lib/breadcrumbs';
import { init as initHttpRequests } from './http_requests';
import { apiService } from '../../public/application/lib/api';
import { breadcrumbService } from '../../public/application/lib/breadcrumbs';

const mockHttpClient = axios.create({ adapter: axiosXhrAdapter });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import { act } from 'react-dom/test-utils';
import { indexSettingDeprecations } from '../common/constants';
import { MIGRATION_DEPRECATION_LEVEL } from '../common/types';
import { indexSettingDeprecations } from '../../common/constants';
import { MIGRATION_DEPRECATION_LEVEL } from '../../common/types';

import { IndicesTestBed, setupIndicesPage, setupEnvironment } from './helpers';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type { DomainDeprecationDetails } from 'kibana/public';
import { act } from 'react-dom/test-utils';
import { deprecationsServiceMock } from 'src/core/public/mocks';
import { UpgradeAssistantStatus } from '../common/types';
import { UpgradeAssistantStatus } from '../../common/types';

import { OverviewTestBed, setupOverviewPage, setupEnvironment } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/upgrade_assistant/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"declarationMap": true
},
"include": [
"__jest__/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
"tests_client_integration/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"public/**/*.json",
"server/**/*.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
notificationServiceMock,
httpServiceMock,
scopedHistoryMock,
} from '../../../../../src/core/public/mocks';
import { AppContextProvider } from '../../public/application/app_context';
import { LicenseStatus } from '../../common/types/license_status';
} from '../../../../../../src/core/public/mocks';
import { AppContextProvider } from '../../../public/application/app_context';
import { LicenseStatus } from '../../../common/types/license_status';

class MockTimeBuckets {
setBounds(_domain: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import sinon, { SinonFakeServer } from 'sinon';
import { ROUTES } from '../../common/constants';
import { ROUTES } from '../../../common/constants';

const { API_ROOT } = ROUTES;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { getWatch } from '../../__fixtures__';
import { getWatch } from '../../../__fixtures__';

export const WATCH_ID = 'my-test-watch';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import axios from 'axios';
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
import { init as initHttpRequests } from './http_requests';
import { setHttpClient, setSavedObjectsClient } from '../../public/application/lib/api';
import { setHttpClient, setSavedObjectsClient } from '../../../public/application/lib/api';

const mockHttpClient = axios.create({ adapter: axiosXhrAdapter });
mockHttpClient.interceptors.response.use(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/

import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../../public/application/lib/navigation';
import { ROUTES, WATCH_TYPES } from '../../../common/constants';
import { withAppContext } from './app_context.mock';
import { WatchEdit } from '../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../public/application/lib/navigation';
import { ROUTES, WATCH_TYPES } from '../../common/constants';

const testBedConfig: TestBedConfig = {
memoryRouter: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { WatchEdit } from '../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../public/application/lib/navigation';
import { ROUTES, WATCH_TYPES } from '../../common/constants';
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../../public/application/lib/navigation';
import { ROUTES, WATCH_TYPES } from '../../../common/constants';
import { withAppContext } from './app_context.mock';

const testBedConfig: TestBedConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import { registerTestBed, TestBed, TestBedConfig } from '@kbn/test/jest';
import { WatchEdit } from '../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../public/application/lib/navigation';
import { ROUTES } from '../../common/constants';
import { WatchEdit } from '../../../public/application/sections/watch_edit/components/watch_edit';
import { registerRouter } from '../../../public/application/lib/navigation';
import { ROUTES } from '../../../common/constants';
import { WATCH_ID } from './jest_constants';
import { withAppContext } from './app_context.mock';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { act } from 'react-dom/test-utils';

import { registerTestBed, findTestSubject, TestBed, TestBedConfig, nextTick } from '@kbn/test/jest';
import { WatchList } from '../../public/application/sections/watch_list/components/watch_list';
import { ROUTES, REFRESH_INTERVALS } from '../../common/constants';
import { WatchList } from '../../../public/application/sections/watch_list/components/watch_list';
import { ROUTES, REFRESH_INTERVALS } from '../../../common/constants';
import { withAppContext } from './app_context.mock';

const testBedConfig: TestBedConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { act } from 'react-dom/test-utils';

import { registerTestBed, findTestSubject, TestBed, TestBedConfig, delay } from '@kbn/test/jest';
import { WatchStatus } from '../../public/application/sections/watch_status/components/watch_status';
import { ROUTES } from '../../common/constants';
import { WatchStatus } from '../../../public/application/sections/watch_status/components/watch_status';
import { ROUTES } from '../../../common/constants';
import { WATCH_ID } from './jest_constants';
import { withAppContext } from './app_context.mock';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { act } from 'react-dom/test-utils';

import { getExecuteDetails } from '../__fixtures__';
import { defaultWatch } from '../public/application/models/watch';
import { getExecuteDetails } from '../../__fixtures__';
import { defaultWatch } from '../../public/application/models/watch';
import { setupEnvironment, pageHelpers, nextTick, wrapBodyResponse } from './helpers';
import { WatchCreateJsonTestBed } from './helpers/watch_create_json.helpers';
import { WATCH } from './helpers/jest_constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import React from 'react';
import { act } from 'react-dom/test-utils';
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
import axios from 'axios';
import { getExecuteDetails } from '../../__fixtures__';
import { WATCH_TYPES } from '../../common/constants';
import {
setupEnvironment,
pageHelpers,
Expand All @@ -17,8 +19,6 @@ import {
unwrapBodyResponse,
} from './helpers';
import { WatchCreateThresholdTestBed } from './helpers/watch_create_threshold.helpers';
import { getExecuteDetails } from '../__fixtures__';
import { WATCH_TYPES } from '../common/constants';

const WATCH_NAME = 'my_test_watch';

Expand Down Expand Up @@ -50,8 +50,8 @@ const WATCH_VISUALIZE_DATA = {

const mockHttpClient = axios.create({ adapter: axiosXhrAdapter });

jest.mock('../public/application/lib/api', () => {
const original = jest.requireActual('../public/application/lib/api');
jest.mock('../../public/application/lib/api', () => {
const original = jest.requireActual('../../public/application/lib/api');

return {
...original,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import axiosXhrAdapter from 'axios/lib/adapters/xhr';
import axios from 'axios';
import { getRandomString } from '@kbn/test/jest';

import { getWatch } from '../__fixtures__';
import { defaultWatch } from '../public/application/models/watch';
import { getWatch } from '../../__fixtures__';
import { defaultWatch } from '../../public/application/models/watch';
import { setupEnvironment, pageHelpers, nextTick, wrapBodyResponse } from './helpers';
import { WatchEditTestBed } from './helpers/watch_edit.helpers';
import { WATCH } from './helpers/jest_constants';

const mockHttpClient = axios.create({ adapter: axiosXhrAdapter });

jest.mock('../public/application/lib/api', () => {
const original = jest.requireActual('../public/application/lib/api');
jest.mock('../../public/application/lib/api', () => {
const original = jest.requireActual('../../public/application/lib/api');

return {
...original,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/

import { act } from 'react-dom/test-utils';
import * as fixtures from '../__fixtures__';
import * as fixtures from '../../__fixtures__';
import { ROUTES } from '../../common/constants';
import { setupEnvironment, pageHelpers, getRandomString, findTestSubject } from './helpers';
import { WatchListTestBed } from './helpers/watch_list.helpers';
import { ROUTES } from '../common/constants';

const { API_ROOT } = ROUTES;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
*/

import { act } from 'react-dom/test-utils';
import moment from 'moment';
import { getWatchHistory } from '../../__fixtures__';
import { ROUTES, WATCH_STATES, ACTION_STATES } from '../../common/constants';
import { setupEnvironment, pageHelpers, nextTick } from './helpers';
import { WatchStatusTestBed } from './helpers/watch_status.helpers';
import { WATCH } from './helpers/jest_constants';
import { getWatchHistory } from '../__fixtures__';
import moment from 'moment';
import { ROUTES } from '../common/constants';
import { WATCH_STATES, ACTION_STATES } from '../common/constants';

const { API_ROOT } = ROUTES;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/watcher/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"declarationMap": true
},
"include": [
"__jest__/**/*",
"server/**/*",
"public/**/*",
"common/**/*",
"tests_client_integration/**/*",
"__fixtures__/*",
"../../../typings/**/*"
],
Expand Down