Example #1
0
      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();
      });
Example #2
0
      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();
      });
Example #3
0
      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();
      });
Example #4
0
 it('should call tasks.insert method', function() {
     sinon.assert.calledOnce(Meteor.call);
     sinon.assert.calledWith(Meteor.call, 'tasks.insert', newTask);
 });