Get help with testing, discuss unit testing strategies etc.


Post by minho »

Hi,
First of all, thanks for heading new approach - free lite version. I am currently evaluating this tool and looks/works pretty well. I especially liked the extjs mvc testing stuff. BTW, i have a quick question: I understood what Siesta.test.ExtJS.willFireNTimes method does, but I don't know where this method is useful. Could you tell me what the intention to bring this method was and in which scenario this is most useful?

and one more suggestion:
It would be great if I could put the comments on each configuration and method section in the api as Sencha doc does.

Post by mats »

Glad you like our tool :). We're constantly trying to improve documentation, so expect things to improve as time goes by.

https://www.bryntum.com/products/siesta/ ... FireNTimes

This method is used to assure that an Observable, say GridPanel or a TextField fires exactly N number of a certain events.

We use this to test our own Gantt chart, for example when switching dates on the timescale, we want exactly one 'viewchange' event to fire. If 2 are fired, it's a bug, as is 0 fired events... Makes sense?

Post by minho »

So this is mainly for controlling test scenario rather than validating actual code. Plus to make sure to destroy any component done for the testing?

Post by mats »

No this is for you to test your component API. If you have any component in your app which fires events (extremely common in Ext JS) then you'll want to assert it's

A. Fired when you expect it to, e.g. Ext.Button should fire 'click' event when clicked
B. Fired exactly as many times as you expect. An Ext.Button firing 2 'click' events would really suck :)

Post by minho »

Thank you very much for your quick replies.
I see. It sounds like it is testing Extjs api (internally) works correctly - i.e close button fire 'destroy' event 1 time or not..

Post by mats »

Yes, though it's not meant to test Ext JS internals. You'll use it to test components used in your application :)

Post by minho »

Right, Extjs components that I use in my application should work as expected and this method tests one aspect of the components.
Thanks for clarifications.

Post Reply