Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 39a98f1

Browse files
committed
Adding quick unit test for React Native prop mapping existence
1 parent bf8fbdd commit 39a98f1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/custom-field-component-spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Provider, connect } from 'react-redux';
66
import thunk from 'redux-thunk';
77
import TestUtils from 'react-addons-test-utils';
88

9+
import { Field as NativeField } from '../lib/native';
10+
911
chai.use(chaiSubset);
1012

1113
const { assert } = chai;
@@ -148,3 +150,20 @@ describe('custom <Field /> components with createFieldClass()', () => {
148150
'testing');
149151
});
150152
});
153+
154+
describe('React Native <Field /> components', () => {
155+
it('should exist', () => {
156+
assert.ok(NativeField);
157+
});
158+
159+
it('should map native components', () => {
160+
// Placeholder div, for now
161+
class TextField extends React.Component {
162+
render() {
163+
return <div />
164+
}
165+
}
166+
167+
assert.ok(<NativeField model="foo.bar"><TextField/></NativeField>);
168+
});
169+
});

0 commit comments

Comments
 (0)