it('should delete when trash is clicked', () => { sinon.stub(remove, 'call'); item.find('.delete-item').simulate('click'); sinon.assert.calledOnce(remove.call); remove.call.restore(); });
it('should update status when checked', () => { sinon.stub(setCheckedStatus, 'call'); item.find('input[type="checkbox"]').simulate('change', { target: { checked: true }, }); sinon.assert.calledWith(setCheckedStatus.call, { playerId: player._id, newCheckedStatus: true, }); setCheckedStatus.call.restore(); });
it('should update text when edited', () => { sinon.stub(updateName, 'call'); item.find('input[type="text"]').simulate('change', { target: { value: 'tested' }, }); sinon.assert.calledWith(updateName.call, { playerId: player._id, newText: 'tested', }); updateName.call.restore(); });
it('should call tasks.insert method', function() { sinon.assert.calledOnce(Meteor.call); sinon.assert.calledWith(Meteor.call, 'tasks.insert', newTask); });