-
+
diff --git a/public/app/plugins/datasource/elasticsearch/components/hooks/useCreatableSelectPersistedBehaviour.test.tsx b/public/app/plugins/datasource/elasticsearch/components/hooks/useCreatableSelectPersistedBehaviour.test.tsx
index 26aea76ad40..8b5f9cb5ede 100644
--- a/public/app/plugins/datasource/elasticsearch/components/hooks/useCreatableSelectPersistedBehaviour.test.tsx
+++ b/public/app/plugins/datasource/elasticsearch/components/hooks/useCreatableSelectPersistedBehaviour.test.tsx
@@ -74,7 +74,10 @@ describe('useCreatableSelectPersistedBehaviour', () => {
// Should call onChange when selecting an already existing option
userEvent.click(option1);
- expect(onChange).toHaveBeenLastCalledWith({ value: 'Option 1', label: 'Option 1' });
+ expect(onChange).toHaveBeenLastCalledWith(
+ { value: 'Option 1', label: 'Option 1' },
+ { action: 'select-option', name: undefined, option: undefined }
+ );
userEvent.click(input);
diff --git a/public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.test.tsx b/public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.test.tsx
index fa6044ea076..3b5da1fe4b4 100644
--- a/public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.test.tsx
+++ b/public/app/plugins/datasource/elasticsearch/configuration/ElasticDetails.test.tsx
@@ -27,7 +27,7 @@ describe('ElasticDetails', () => {
const onChangeMock = jest.fn();
const wrapper = mount();
const selectEl = wrapper.find({ label: 'Pattern' }).find(Select);
- selectEl.props().onChange({ value: 'Daily', label: 'Daily' });
+ selectEl.props().onChange({ value: 'Daily', label: 'Daily' }, { action: 'select-option', option: undefined });
expect(onChangeMock.mock.calls[0][0].jsonData.interval).toBe('Daily');
expect(onChangeMock.mock.calls[0][0].database).toBe('[logstash-]YYYY.MM.DD');
@@ -40,7 +40,7 @@ describe('ElasticDetails', () => {
const wrapper = mount();
const selectEl = wrapper.find({ label: 'Pattern' }).find(Select);
- selectEl.props().onChange({ value: 'Monthly', label: 'Monthly' });
+ selectEl.props().onChange({ value: 'Monthly', label: 'Monthly' }, { action: 'select-option', option: undefined });
expect(onChangeMock.mock.calls[0][0].jsonData.interval).toBe('Monthly');
expect(onChangeMock.mock.calls[0][0].database).toBe('[logstash-]YYYY.MM');
@@ -78,7 +78,12 @@ describe('ElasticDetails', () => {
});
const selectEl = wrapper.find({ label: 'Version' }).find(Select);
- selectEl.props().onChange({ value: tc.version, label: tc.version.toString() });
+ selectEl
+ .props()
+ .onChange(
+ { value: tc.version, label: tc.version.toString() },
+ { action: 'select-option', option: undefined }
+ );
expect(last(onChangeMock.mock.calls)[0].jsonData.maxConcurrentShardRequests).toBe(
tc.expectedMaxConcurrentShardRequests
diff --git a/yarn.lock b/yarn.lock
index 8817270a48c..e9ca85d928e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2508,6 +2508,8 @@ __metadata:
"@rollup/plugin-commonjs": 21.0.1
"@rollup/plugin-node-resolve": 13.0.6
"@sentry/browser": 5.25.0
+ "@testing-library/react": ^12.1.2
+ "@testing-library/user-event": ^13.5.0
"@types/angular": 1.6.56
"@types/history": ^4.7.8
"@types/jest": 27.0.2
@@ -6845,7 +6847,7 @@ __metadata:
languageName: node
linkType: hard
-"@testing-library/react@npm:12.1.2":
+"@testing-library/react@npm:12.1.2, @testing-library/react@npm:^12.1.2":
version: 12.1.2
resolution: "@testing-library/react@npm:12.1.2"
dependencies:
@@ -6869,6 +6871,17 @@ __metadata:
languageName: node
linkType: hard
+"@testing-library/user-event@npm:^13.5.0":
+ version: 13.5.0
+ resolution: "@testing-library/user-event@npm:13.5.0"
+ dependencies:
+ "@babel/runtime": ^7.12.5
+ peerDependencies:
+ "@testing-library/dom": ">=7.21.4"
+ checksum: 16319de685fbb7008f1ba667928f458b2d08196918002daca56996de80ef35e6d9de26e9e1ece7d00a004692b95a597cf9142fff0dc53f2f51606a776584f549
+ languageName: node
+ linkType: hard
+
"@tootallnate/once@npm:1":
version: 1.1.2
resolution: "@tootallnate/once@npm:1.1.2"