PDA

View Full Version : Ext JS 4.x view Testing - Jasmine



vipinsudhakar
17 Feb 2014, 12:01 AM
Hi,


I am learning ExtJs + Jasmine. I am totally new to both. Please help me to get the number of columns in a view for Testing it.


I have followed as below;



it('grid should have correct amount of columns', function () {
view= Application.getView('ClientView');
expect(view.columns.length).toEqual(9);
});


I have verified the view is toBeTruthy. Its working as expected.



it('Should initialize client view', function () {
view= Application.getView('ClientView');
expect(view).toBeTruthy();
});


But for columns, I am getting below error,


TypeError: Cannot read property 'length' of undefined


Please help me to solve this issue.

mitchellsimoens
20 Feb 2014, 8:06 AM
Have you inspected what "Application.getView('ClientView');" returns? Is it an instance or a class definition?