在以下测试中,我收到错误:
错误:未使用[[studentId:0]]
调用间谍有谁能告诉我studentId来自哪里以及为什么我会收到错误?
describe('<EditStudentDocuments />', () => {
var updateStudentDataSpy = expect.createSpy();
beforeEach(() => {
mockery.enable();
});
afterEach(() => {
mockery.disable();
});
it('should render EditStudentDocumentsTable', () => {
var wrapper = shallow(<EditStudentDocuments />);
expect(wrapper.find(EditStudentDocumentsTable).length).toBe(1);
});
it('should render EditStudentDocumentsTable 2', () => {
var updateStudentDataSpy = expect.createSpy();
var mockStudentDataActions = {
updateStudentData: updateStudentDataSpy
};
mockery.registerMock('../../../actions/studentDataActions', mockStudentDataActions);
const myRow = { };
const data = { row : myRow, type: "myType" };
var wrapper = shallow(<EditStudentDocuments />);
wrapper.find(EditStudentDocumentsTable).props().onTableUpdate(data);
expect(updateStudentDataSpy).toHaveBeenCalledWith(myRow);
});