Skip to content

Commit

Permalink
Delete src/legacy/ui/public folder (#76085)
Browse files Browse the repository at this point in the history
* delete src/legacy/ui/public folder

* remove jest.mock('ui/XXX'); from tests

* adapt stubbedLogstashIndexPatternService

* remove delete keys from translation files

* fix types import with Capabilities

* remove legacy test utils

* remove dead file referencing ui/newPlatform

* move saved-object-finder styles to timelion plugin
  • Loading branch information
pgayvallet authored Sep 1, 2020
1 parent 086e488 commit e70ef65
Show file tree
Hide file tree
Showing 290 changed files with 88 additions and 25,467 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ const createMockStorage = () => ({
length: 0,
});

jest.mock('ui/chrome', () => {
return {
getBasePath: () => `/some/base/path`,
};
});

const historyName = 'testHistory';
const historyLimit = 10;
const payload = [
Expand Down
1 change: 0 additions & 1 deletion src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default {
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
'^src/plugins/(.*)': '<rootDir>/src/plugins/$1',
'^plugins/([^/.]*)(.*)': '<rootDir>/src/legacy/core_plugins/$1/public$2',
'^ui/(.*)': '<rootDir>/src/legacy/ui/public/$1',
'^uiExports/(.*)': '<rootDir>/src/dev/jest/mocks/file_mock.js',
'^test_utils/(.*)': '<rootDir>/src/test_utils/public/$1',
'^fixtures/(.*)': '<rootDir>/src/fixtures/$1',
Expand Down
4 changes: 0 additions & 4 deletions src/dev/jest/setup/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
* The mocks that are enabled that way live inside the `__mocks__` folders beside their implementation files.
*/

jest.mock('ui/metadata');
jest.mock('ui/documentation_links/documentation_links');
jest.mock('ui/chrome');

jest.mock('moment-timezone', () => {
// We always want to mock the timezone moment-timezone guesses, since otherwise
// test results might be depending on which time zone you are running them.
Expand Down
17 changes: 9 additions & 8 deletions src/fixtures/stubbed_logstash_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import StubIndexPattern from 'test_utils/stub_index_pattern';
import stubbedLogstashFields from 'fixtures/logstash_fields';

import { getKbnFieldType } from '../plugins/data/common';
import { npSetup } from '../legacy/ui/public/new_platform/new_platform.karma_mock';
import { uiSettingsServiceMock } from '../core/public/ui_settings/ui_settings_service.mock';

const uiSettingSetupMock = uiSettingsServiceMock.createSetupContract();
uiSettingSetupMock.get.mockImplementation((item, defaultValue) => {
return defaultValue;
});

export default function stubbedLogstashIndexPatternService() {
const mockLogstashFields = stubbedLogstashFields();
Expand All @@ -41,13 +46,9 @@ export default function stubbedLogstashIndexPatternService() {
};
});

const indexPattern = new StubIndexPattern(
'logstash-*',
(cfg) => cfg,
'time',
fields,
npSetup.core
);
const indexPattern = new StubIndexPattern('logstash-*', (cfg) => cfg, 'time', fields, {
uiSettings: uiSettingSetupMock,
});

indexPattern.id = 'logstash-*';
indexPattern.isTimeNanosBased = () => false;
Expand Down
3 changes: 0 additions & 3 deletions src/legacy/ui/public/.eslintrc

This file was deleted.

25 changes: 0 additions & 25 deletions src/legacy/ui/public/__mocks__/metadata.ts

This file was deleted.

244 changes: 0 additions & 244 deletions src/legacy/ui/public/__tests__/events.js

This file was deleted.

29 changes: 0 additions & 29 deletions src/legacy/ui/public/__tests__/metadata.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/legacy/ui/public/_index.scss

This file was deleted.

Loading

0 comments on commit e70ef65

Please sign in to comment.