0
농담이 조롱과 얕은 렌더링 효소 사용은재귀 콜백 노드를 테스트 및/또는 모의 해보고 Jest mocking + Enzyme shallow와 함께 .querySelector를 테스트하는 방법? 다음? 테스트하거나 조롱 얼마나
onClick =() => {
const inputNode = this.node.querySelector('input');
inputNode.click();
};
나는 시도 :
여기it('calls button',() => {
const wrapper = shallow(
<Component />,
);
const wrapperInstance = wrapper.instance();
const inputNode = document.createElement('input');
inputNode.value = '';
const node = document.createElement('div').appendChild(inputNode);
wrapperInstance.node = node;
});