I've got a Sencha Touch MVC app that I'm trying to write some tests for using Jasmine. I've having some success, but I'm stumped so far on trying to test a controller's action method.

For example, I've got an action method that looks like this:

mapContact : function(params) {
    // Do some stuff here
    this.application.contactPanel.setActiveItem(contactMapPanel, {type:'slide', direction:'left'});
}

where contactMapPanel is a panel contained within contactPanel. What is the best way to test this method in Jasmine? How can I test that the active item is indeed correctly set to contactMapPanel?

有帮助吗?

解决方案

Turns out that this is not such a good idea--it's considered more of an integration test, and jasmine is for unit testing. See : http://www.sencha.com/forum/showthread.php?151594-Test-a-Sencha-Touch-Controller-using-Jasmine

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top