From b8031cc66bb288463d3237751d2636bc7d72e5c3 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:40:36 +1100 Subject: [PATCH] [8.x] Fix for the flaky failing test: Jest Tests.x-pack/plugins/stack_connectors/public/connector_types/inference - ConnectorFields renders Validation validates correctly "url-input" (#204835) (#204868) # Backport This will backport the following commits from `main` to `8.x`: - [Fix for the flaky failing test: Jest Tests.x-pack/plugins/stack_connectors/public/connector_types/inference - ConnectorFields renders Validation validates correctly "url-input" (#204835)](https://github.com/elastic/kibana/pull/204835) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Yuliia Naumenko --- .../connector_types/inference/connector.test.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.test.tsx index 40521db244142..e75223f656d13 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.test.tsx @@ -799,7 +799,7 @@ describe('ConnectorFields renders', () => { ...openAiConnector.config, providerConfig: { url: '', - modelId: 'gpt-4o', + model_id: 'gpt-4o', }, }, }; @@ -809,6 +809,10 @@ describe('ConnectorFields renders', () => { {}} /> ); + await userEvent.type( + res.getByTestId('api_key-password'), + '{selectall}{backspace}goodpassword' + ); await userEvent.click(res.getByTestId('form-test-provide-submit')); await waitFor(async () => { @@ -819,7 +823,7 @@ describe('ConnectorFields renders', () => { }); const tests: Array<[string, string]> = [ - ['url-input', 'not-valid'], + ['url-input', ''], ['api_key-password', ''], ]; it.each(tests)('validates correctly %p', async (field, value) => { @@ -837,9 +841,7 @@ describe('ConnectorFields renders', () => { ); - await userEvent.type(res.getByTestId(field), `{selectall}{backspace}${value}`, { - delay: 10, - }); + await userEvent.type(res.getByTestId(field), `{selectall}{backspace}${value}`); await userEvent.click(res.getByTestId('form-test-provide-submit')); await waitFor(async () => {