我正在我的react应用程序上测试表单组件。我在这里得到了一个与未解决的帖子(Testing form input in jest and enzyme)类似的错误。 我尝试了下面两种不同的form.test.js方法,都不能通过测试。 //simple form component
import React from "react";
import Checkbox from "../checkbox/checkbox.component";
import { withRouter } from 'react-router-dom';
c
一般来说,我对Vuejs和JS框架非常陌生,所以请耐心等待。我试图从一个子组件(2层深)中调用一个驻留在根组件中的方法,将其作为一个属性传递,但我得到了错误:
Uncaught TypeError: this.onChange is not a function
at VueComponent._onChange (category.js:8)
at boundFn (vendor.js?okqp5g:361)
at HTMLInputElement.invoker (vendor.js?okqp5g:2179)
我不确定将prop赋值给子组件内的方法是否正确,但请看您的想法:
index.j
我有一个包含两个属性的视图模型。
public class ControlToRender
{
public int IsText { get; set; }
public string LabelString { get; set; }
public string TextValue { get; set; }
}
这是在控制器中填充的,因此:
IsText = True;
LabelString = "please enter your name";
TextValue = "";
在我看来,我正在测试上面的内容如下:
if