From 036bfc909db6a25cd0af12ee4f5480b72ed25630 Mon Sep 17 00:00:00 2001 From: Felix Mosheev <9304194+felixmosh@users.noreply.github.com> Date: Sun, 22 Dec 2019 11:19:09 +0200 Subject: [PATCH 1/2] Fix deprecated lifecycle method usage in tests Fix async tests that not used done and passed without a good reason :] --- __test_utils__/DynamicInputForm.tsx | 35 +++++++ __tests__/Element-spec.tsx | 4 +- __tests__/Formsy-spec.tsx | 157 +++++++++++++++------------- 3 files changed, 123 insertions(+), 73 deletions(-) create mode 100644 __test_utils__/DynamicInputForm.tsx diff --git a/__test_utils__/DynamicInputForm.tsx b/__test_utils__/DynamicInputForm.tsx new file mode 100644 index 00000000..73088683 --- /dev/null +++ b/__test_utils__/DynamicInputForm.tsx @@ -0,0 +1,35 @@ +import * as React from 'react'; +import Formsy from '../src'; +import TestInput from './TestInput'; + +interface DynamicInputFormProps { + onSubmit: (model: any) => void; + inputName?: string; +} + +class DynamicInputForm extends React.Component { + public state = { + input: null, + }; + + private addInput = () => { + const { inputName } = this.props; + this.setState({ + input: , + }); + }; + + public render() { + return ( + <> + + {this.state.input} + {this.props.children} + +