Skip to content

Commit

Permalink
test: update cases
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqiboy committed Mar 30, 2020
1 parent 1b6c940 commit 8f017f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ docs/
src/
npm/
jest/
coverage/
tests/
*.un~
/jsconfig.json
Expand Down
2 changes: 2 additions & 0 deletions tests/withField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const CustomField = withField(({ $fieldutil, ...others }) => {
});

test('should pass $fieldutil', async () => {
expect(CustomField.displayName).toBe('React.Formutil.withField.ForwardRef.Anonymous');

const { getFormutil, getByTestId } = renderForm(<CustomField name="a" $defaultValue="1" data-testid="input" />);

expect(getFormutil().$params).toEqual({
Expand Down
3 changes: 3 additions & 0 deletions tests/withForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ function FormPage() {
test('withForm', () => {
const formutilRef = React.createRef<$Formutil>();
const Form = withForm(FormPage);

expect(Form.displayName).toBe('React.Formutil.withForm.ForwardRef.FormPage');

render(<Form $ref={formutilRef} />);

expect(formutilRef.current!.$params).toEqual({
Expand Down

0 comments on commit 8f017f7

Please sign in to comment.