Skip to content

Commit 5fb92c8

Browse files
committed
adding a valid file and a timeout
1 parent c6e6bae commit 5fb92c8

File tree

1 file changed

+8
-2
lines changed
  • x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step

1 file changed

+8
-2
lines changed

x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.test.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,20 @@ describe('UploadSpecStep', () => {
8282
target: { value: 'testDataStreamTitle' },
8383
});
8484
});
85+
const validSpec = JSON.stringify({
86+
openapi: '3.0.0',
87+
paths: { '/test': { get: {} } },
88+
});
8589
const filepicker = result.getByTestId('apiDefinitionFilePicker');
8690
await act(async () => {
8791
fireEvent.change(filepicker, {
88-
target: { files: [new File(['...'], 'test.json', { type: 'application/json' })] },
92+
target: { files: [new File([validSpec], 'test.json', { type: 'application/json' })] },
8993
});
9094
});
9195
// Wait for the file to be fully processed and button to become enabled
92-
await waitFor(() => expect(result.queryByTestId('analyzeApiButton')).toBeEnabled());
96+
await waitFor(() => expect(result.queryByTestId('analyzeApiButton')).toBeEnabled(), {
97+
timeout: 3000,
98+
});
9399
});
94100

95101
it('analyze button re-enabled', () => {

0 commit comments

Comments
 (0)