Hybrid View

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default B3 MVC Controller Unit Test Problems

    B3 MVC Controller Unit Test Problems


    I am having one hell of a time getting a simple Jasmine unit test to run for one of my controllers because of its dependency on Ext.app.Application. I am getting one error after another from the Loader even after overriding the bindReady function in Ext.app.Application. I really think an example of some simple unit tests needs to be included in the final release.

  2. #2
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    We'll include unit tests for the MVC examples, probably in the next release.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #3
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    Sounds great thanks for the response.

  4. #4
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    So Ed what happened to those MVC unit testing examples?

  5. #5
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    Still very much looking for help with this. MVC in Sencha Touch includes hooks to disable automatic application loading which is required to enable unit testing of controller classes. I do not see the same hooks when browsing the source for MVC in ExtJS 4.

    Ext.app.Controller: line 189
    Code:
    TypeError: Cannot call method 'getModel' of undefined

  6. #6
    Ext Premium Member halcwb's Avatar
    Join Date
    Mar 2010
    Location
    Rotterdam
    Posts
    379
    Vote Rating
    39
    halcwb has a spectacular aura about halcwb has a spectacular aura about

      0  

    Default TypeError: Cannot call method 'getModel' of undefined

    TypeError: Cannot call method 'getModel' of undefined


    I run into the same problem. I like to write some unit tests for my controllers using Jasmine. However I cannot create a controller using Ext.create because of the TypeError: Cannot call method 'getModel' of undefined.

    I browsed the svn source code but could not find how to handle this. However, I would very much appreciate to be able to write unit test. By the way, at the moment I am using the latest production code for ExtJs 4.0.

Similar Threads

  1. ExtJS Jasmine unit test reporter?
    By Scott Murawski in forum Community Discussion
    Replies: 4
    Last Post: 9 Dec 2011, 12:53 PM
  2. Unit test cases
    By nivis1990 in forum Community Discussion
    Replies: 0
    Last Post: 9 Mar 2011, 9:05 PM
  3. Unit Test
    By sg707 in forum Ext: Discussion
    Replies: 1
    Last Post: 16 Feb 2011, 1:57 PM
  4. Howto unit test widgets?
    By KaiWeing in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 9 Aug 2010, 8:33 AM
  5. JS Unit Test Panel
    By Ronaldo in forum Ext 2.x: User Extensions and Plugins
    Replies: 9
    Last Post: 20 Feb 2009, 9:32 AM

Thread Participants: 5