From 9f01087417b7d257b385067063ec7a3113982c59 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Wed, 18 Dec 2024 18:54:57 -0800 Subject: [PATCH] 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) Resolves https://github.com/elastic/kibana/issues/204806 --- .../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 d351f6acdc124..5d20ff9595483 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 @@ -805,7 +805,7 @@ describe('ConnectorFields renders', () => { ...openAiConnector.config, providerConfig: { url: '', - modelId: 'gpt-4o', + model_id: 'gpt-4o', }, }, }; @@ -815,6 +815,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 () => { @@ -825,7 +829,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) => { @@ -843,9 +847,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 () => {