Search and Top Navigation
#4991 closed enhancement (wontfix)
Opened December 03, 2009 12:09PM UTC
Closed January 27, 2010 01:44PM UTC
Last modified October 11, 2012 09:15PM UTC
[PATCH] enhancing simulate.js to accept jquery as drop target
Reported by: | dwt | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.core | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Many tests are much easier written if you can just tell the simulate the id or jquery object you want to drop on.
Here's an example:
this.domFor(this.story1).simulate('drag', {dropTarget: this.domFor(this.task2)}); same(this.view.currentOrderOfTickets(), [1,4,5,2,3,6,7]);
So I have expanded the method a bit (see patch for details)
simulate is designed to simulate a true browser event, as closely as possible. The contract it provides is that the event hash you pass it the event hash that will be passed to the simulated event. Intercepting those values and mucking with them is a bit too much magic, and can simply be handled by convenience functions that call .simulate.
In other words, it's low-level and it's meant to be.