<input type="text" className="task-item-name" name="title" placeholder="Enter task item name" required="" ref={c => this.inputTaskItemName = c} />
this.inputTaskItemName.value,
test('FormTaskItem New filds', () => {
component.find(".task-item-name").at(0).simulate('change', { target: { value: 'test name' } });
component.find(".task-item-text").at(0).simulate('change', { target: { value: 'test text' } });
console.log(component.find(".task-item-name").at(0));
const btn = component.find(".form-submit");
btn.simulate('click');
expect(actionsetNewTaskItem).toHaveBeenCalledWith({
keychapter: "-Mnu71_BYp_test",
title: 'test name',
text: 'test text'
}, dispatch);
});
addNewTaskItem = () => {
console.log("тест тест");
console.log(this.inputTaskItemName);
let data = { keychapter: this.state.openFormTaskItemNew.keychapter, title: this.inputTaskItemName.value, text: this.inputTaskItemText.value };
actionsetNewTaskItem(data, this.props.dispatch);
}
addNewTaskItem = () => {
let data = { keychapter: this.state.openFormTaskItemNew.keychapter, title: this.inputTaskItemName.current.value, text: this.inputTaskItemText.current.value };
actionsetNewTaskItem(data, this.props.dispatch);
}