我有以下本机测试代码。
if (!!activeConnections[testID]) {
logger.info("reconnected..");
clearTimeout(activeConnections[testID].timeout);
} else {
activeConnections[testID] = {};
socket.candidateTestId = testID;
activeConnections[testID].testSubmitted = false;
activeConnections[testID].candidateTestId = testID;
activeConnections[testID].timeout = undefined;
}
socket.on("disconnect", function () {
callTimeOutToSubmitTest(socket.candidateTestId, socket);
});
这不能正常工作。我要检查的是按钮文本。 我该怎么办?
答案 0 :(得分:5)
我认为我们需要将.props
替换为.props()
,而且toEqual
的语法也应该像这样-:
expect(wrapper.find(BorderlessButton).props().text).toEqual('D');