blob: 1ca386346e89f7a96b8057065a6034d7515e051d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
import React, { Component } from 'react'
import CustomFieldsInputs from '../../../../app/javascript/helpers/CustomFieldsInputs'
import renderer from 'react-test-renderer'
require('select2')
describe('CustomFieldsInputs', () => {
set('values', () => {
return {}
})
set('component', () => {
let inputs = renderer.create(
<CustomFieldsInputs
values={values}
disabled={false}
onUpdate={()=>{}}
/>
).toJSON()
return inputs
})
it('should match the snapshot', () => {
expect(component).toMatchSnapshot()
})
// context('with fields', () => {
// set('values', () => {
// return {
// foo: {
// options: { list_values: ["", "1", "2"] },
// field_type: "list",
// name: "test"
// }
// }
// })
// it('should match the snapshot', () => {
// expect(component).toMatchSnapshot()
// })
// })
})
|