Skip to content

Commit

Permalink
fix jest
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Jun 5, 2024
1 parent fedf2a2 commit 1f60922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export function IndexSelection({ selectedDataView }: { selectedDataView?: DataVi
});

useEffect(() => {
if (!currentDataViewId && currentIndexPattern && !isDataViewsLoading) {
const indPattern = getDataViewPattern({
byPatten: currentIndexPattern,
dataViewsList,
adHocDataViews,
});
setValue(DATA_VIEW_FIELD, indPattern);
const indPatternId = getDataViewPattern({
byPatten: currentIndexPattern,
dataViewsList,
adHocDataViews,
});
if (!currentDataViewId && currentIndexPattern && !isDataViewsLoading && indPatternId) {
setValue(DATA_VIEW_FIELD, indPatternId);
}
}, [
adHocDataViews,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const mockKibana = (license: ILicense | null = licenseMock) => {
create: jest.fn().mockResolvedValue({
getIndexPattern: jest.fn().mockReturnValue('some-index'),
getRuntimeMappings: jest.fn().mockReturnValue({}),
id: 'some-data-view-id',
}),
},
docLinks: {
Expand Down

0 comments on commit 1f60922

Please sign in to comment.