-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
NP Migration: Move doc views registry and existing doc views into discover plugin #53465
Changes from 2 commits
f112668
e817686
505f772
30c4be7
52faac2
f70388b
bf25c02
0b553d7
e7774ed
d56a8d8
88634c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; | |
import { Doc, DocProps } from './doc'; | ||
|
||
jest.mock('../doc_viewer/doc_viewer', () => ({ | ||
DocViewer: 'test', | ||
DocViewer: () => null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the doc viewer is actually rendered (which happens now because of async |
||
})); | ||
|
||
jest.mock('../../kibana_services', () => { | ||
|
@@ -67,7 +67,7 @@ async function mountDoc(search: () => void, update = false, indexPatternGetter: | |
indexPatternService, | ||
} as DocProps; | ||
let comp!: ReactWrapper; | ||
act(() => { | ||
await act(async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some here - getting rid of react warnings during test run |
||
comp = mountWithIntl(<Doc {...props} />); | ||
if (update) comp.update(); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ describe('Test of <Doc /> helper / hook', () => { | |
`); | ||
}); | ||
|
||
test('useEsDocSearch', () => { | ||
test('useEsDocSearch', async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a small cleanup getting rid of the |
||
const indexPattern = { | ||
getComputedFields: () => [], | ||
}; | ||
|
@@ -53,16 +53,16 @@ describe('Test of <Doc /> helper / hook', () => { | |
const props = { | ||
id: '1', | ||
index: 'index1', | ||
esClient: { search: jest.fn() }, | ||
esClient: { search: jest.fn(() => new Promise(() => {})) }, | ||
indexPatternId: 'xyz', | ||
indexPatternService, | ||
} as DocProps; | ||
let hook; | ||
act(() => { | ||
await act(async () => { | ||
hook = renderHook((p: DocProps) => useEsDocSearch(p), { initialProps: props }); | ||
}); | ||
// @ts-ignore | ||
expect(hook.result.current).toEqual([ElasticRequestState.Loading, null, null]); | ||
expect(hook.result.current).toEqual([ElasticRequestState.Loading, null, indexPattern]); | ||
expect(indexPatternService.get).toHaveBeenCalled(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ready to be consumed by new platform plugins? it means no webpack imports, no global angular
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's still in the legacy world for now, good point. I will remove it.