小编Mar*_*son的帖子

Redux-Form v7字段组件打字稿错误

这是我使用Field组件的代码:

    interface EditProfileFormProps extends FormProps {
    	defaults: object;
    	submit: () => {};
    	initialValues: object;
    	roles: object[];
    	specialties: object[];
    }

const EditProfileForm: React.StatelessComponent<EditProfileFormProps> = (props: EditProfileFormProps) => {
	return (
		<Form onSubmit={props.submit}>
		    <div>
		      <Field name="firstName" component={FirstName} type="text" />
		    </div>
		    <div>
		      <Field name="lastName" component={LastName} type="text" />
		    </div>
		    <div>
		      <Field name="role" props={{ roles: props.roles }} component={Role} type="select" />
		    </div>
		</Form>
	);
};

//FirstName.tsx
export const FirstName: React.StatelessComponent<React.InputHTMLAttributes<HTMLInputElement>> = ({
	input,
}: React.InputHTMLAttributes<HTMLInputElement> & WrappedFieldProps) => (
	<FormGroup>
	 <Label for="firstName">First Name</Label>
	 <Input {...input} type="text" …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs redux redux-form

5
推荐指数
1
解决办法
551
查看次数

在 TestCafe 中,有没有办法知道钩子后测试是通过还是失败?

我正在尝试在我的 testcafe 测试运行时通过 rest API (Zephyr) 将测试标记为通过/失败。我想知道是否有可能在afterafterEach钩子中知道测试是否通过/失败,以便我可以根据结果运行一些脚本。

就像是:

test(...)
.after(async t => {
  if(testFailed === true) { callApi('my test failed'); }
})
Run Code Online (Sandbox Code Playgroud)

hook automated-tests e2e-testing testcafe

3
推荐指数
1
解决办法
1511
查看次数