How to write test cases on drop and down using jquery in ember.js framework?


#1

This is javascript/jquery to test drag n drop in ember: I am not sure why it is not running:

/* test(‘dragdrop’, function(assert){ this.render(hbs{{dragdrop}}); (function(export){ var datatransfermock = function (){}; datatransfermock.prototype.setdata = function(format,data){ this[format]= data; }; datatransfermock.prototype.getdata = function(format){ if(this.hasownproperty(format)){ return this[format]; }else{ return null; } }; exports.datatransferMock=Datatransfermock; })(window); ember.run(function(){ var sourcedata = this.('.draggable:eq(0)'), targetdata = this.(’.draggable:eq(1)’), datastartevent = .event('dragstart'), dropevent - .event(‘drop’); dragstartevent.datatransfer = new datatransfermock(); sourcedata.trigger(dragstartevent); dropevent.datatransfer = dragstartevent.datatransfer; targetdata.trigger(dropevent); sourcedata.trigger(‘dragend’); }); }); */