Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Testing CanJS Web Apps

$
0
0
An instance of a Control would not have a trigger method unless you created one.

The event handler you have in your Control will not work because there is no CSS selector. All of this is documented here.

Once that is sorted out, you can get on with triggering events.

For testing purposes, doing S('selector for div').click()will simulate a click event on that div including firing a click event.

In your app code, you can use this exact code to trigger a click:
  1. $('selector for div').trigger('click')
  2. //OR
  3. can.trigger($('selector for div'), 'click')
We spend a lot of time making sure the docs for CanJS are the best out there, so try consulting those: here and here.

Viewing all articles
Browse latest Browse all 3491

Trending Articles