-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simeon Widdis <[email protected]>
- Loading branch information
Showing
3 changed files
with
229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...ic/components/integrations/components/__tests__/__snapshots__/upload_flyout.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Integration Upload Flyout Renders integration upload flyout as expected 1`] = ` | ||
<EuiFlyout | ||
onClose={[Function]} | ||
size="s" | ||
> | ||
<EuiFlyoutHeader> | ||
Upload Integrations | ||
</EuiFlyoutHeader> | ||
<EuiFlyoutBody> | ||
<IntegrationUploadPicker | ||
isInvalid={true} | ||
onFileSelected={[Function]} | ||
setIsInvalid={[Function]} | ||
/> | ||
</EuiFlyoutBody> | ||
<EuiFlyoutFooter> | ||
<EuiFlexGroup | ||
justifyContent="spaceBetween" | ||
> | ||
<EuiFlexItem | ||
grow={false} | ||
> | ||
<EuiButton | ||
onClick={[Function]} | ||
> | ||
Cancel | ||
</EuiButton> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
grow={false} | ||
> | ||
<EuiButton | ||
disabled={true} | ||
fill={true} | ||
onClick={[Function]} | ||
> | ||
Upload | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlyoutFooter> | ||
</EuiFlyout> | ||
`; | ||
|
||
exports[`Integration Upload Flyout Renders the clean integration picker as expected 1`] = ` | ||
<EuiForm> | ||
<EuiFormRow | ||
describedByIds={Array []} | ||
display="row" | ||
error={ | ||
Array [ | ||
"Must be an ndjson bundle of integration templates", | ||
] | ||
} | ||
fullWidth={false} | ||
hasChildLabel={true} | ||
hasEmptyLabelSpace={false} | ||
isInvalid={false} | ||
label="Select file" | ||
labelType="label" | ||
> | ||
<EuiFilePicker | ||
compressed={false} | ||
display="large" | ||
id="integrationBundlePicker" | ||
initialPromptText="Select or drag and drop integration bundles" | ||
isInvalid={false} | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
/> | ||
</EuiFormRow> | ||
</EuiForm> | ||
`; |
36 changes: 36 additions & 0 deletions
36
public/components/integrations/components/__tests__/upload_flyout.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { configure, shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import React from 'react'; | ||
import { waitFor } from '@testing-library/react'; | ||
import { IntegrationUploadFlyout, IntegrationUploadPicker } from '../upload_flyout'; | ||
|
||
describe('Integration Upload Flyout', () => { | ||
configure({ adapter: new Adapter() }); | ||
|
||
it('Renders integration upload flyout as expected', async () => { | ||
const wrapper = shallow(<IntegrationUploadFlyout onClose={() => {}} />); | ||
|
||
await waitFor(() => { | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
it('Renders the clean integration picker as expected', async () => { | ||
const wrapper = shallow( | ||
<IntegrationUploadPicker | ||
isInvalid={true} | ||
setIsInvalid={(_) => {}} | ||
onFileSelected={(_) => {}} | ||
/> | ||
); | ||
|
||
await waitFor(() => { | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |