Skip to content

Commit 54ed57b

Browse files
Add spec
1 parent a00c337 commit 54ed57b

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`CodeEditor component should render correctly 1`] = `
4+
<div>
5+
<div
6+
className="entry-point-wrapper"
7+
>
8+
<div
9+
className="entry-point-text-input"
10+
>
11+
<TextInput
12+
id="provisioning_entry_point_workflow"
13+
labelText="Provisioning Entry Point"
14+
onChange={[Function]}
15+
type="text"
16+
value=""
17+
/>
18+
</div>
19+
<div
20+
className="entry-point-buttons"
21+
>
22+
<Button
23+
hasIconOnly={true}
24+
iconDescription="Click to select Provisioning Entry Point"
25+
onClick={[Function]}
26+
renderIcon={
27+
Object {
28+
"$$typeof": Symbol(react.forward_ref),
29+
"render": [Function],
30+
}
31+
}
32+
/>
33+
</div>
34+
</div>
35+
</div>
36+
`;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import { shallow } from 'enzyme';
3+
import { shallowToJson } from 'enzyme-to-json';
4+
5+
import ProvisionEntryPoint from '../../components/provision-entry-point';
6+
7+
jest.mock('@@ddf', () => ({
8+
useFieldApi: (props) => ({ meta: {}, input: {}, ...props }),
9+
}));
10+
11+
describe('CodeEditor component', () => {
12+
let initialProps;
13+
beforeEach(() => {
14+
initialProps = {
15+
id: 'provisioning_entry_point_workflow',
16+
name: 'provisioning_entry_point_workflow',
17+
label: 'Provisioning Entry Point',
18+
field: 'fqname',
19+
selected: '',
20+
type: 'provision',
21+
};
22+
});
23+
24+
it('should render correctly', () => {
25+
const wrapper = shallow(<ProvisionEntryPoint {...initialProps} />);
26+
expect(shallowToJson(wrapper)).toMatchSnapshot();
27+
});
28+
});

0 commit comments

Comments
 (0)