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

Delete src/legacy/ui/public folder #76085

Merged
merged 12 commits into from
Sep 1, 2020
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 @@ -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,
});

Comment on lines -44 to 52
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual code change of the PR. The StubIndexPattern is only accessing uiSettings API, so I created an inline mock to replace the '../legacy/ui/public/new_platform/new_platform.karma_mock' import.

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