Get help with testing, discuss unit testing strategies etc.


Post by AaronTovo »

I think I found a minor bug...
                t.firesOk(app, 'newsearchparams', 1, 10, function() {
                    t.click(searchButton);
                }, 'click firesOk reported correctly for newsearchparams', next);
prints "Exacly 1 'newsearchparams' events have been fired" in the results which is fine, but it fails to print 'click firesOk reported correctly for newsearchparams'.

Also some nitpicks... the documentation for hasListener at https://bryntum.com/products/siesta/docs ... Observable is missing the desc parameter (which does work for this function) and the event and eventName parameters are missing their descriptions and eventName is missing its type (ie, ' : String').

Post by AaronTovo »

Another documentation error... I think the middle parameter in https://bryntum.com/products/siesta/docs ... .FormField should be of type Object (the type returned by Ext.form.field.Base.getValue()) and have a name like 'value'.

Post by jakub »

Just tested on one of scheduler's examples :
        t.firesOk(scheduler, 'eventclick', 3, 1000, function(){
            t.click(taskEl);
        }, 'Foobar', function(){console.log('foo');});
Everything works as it should. Please double-check your code. Do you use the latest Siesta version ?
JavaScript/Angular/ExtJS consulting - kuba@virtualdesign.pl

Post by mats »

I fixed the docs for hasListener. Regarding fieldHasValue method, this is the docs which is correct, isn't it?
/**
         * Passes if the passed Field has the expected value.
         * 
         * @param {Ext.form.field.Field/String} field A form field or a ComponentQuery
         * @param {Mixed} value The value to compare to.
         * @param {String} description The description of the assertion
         */
        fieldHasValue : function(field, value, description) {
            field = this.normalizeComponent(field);
            this.is(field.getValue(), value, description);
        },

Post by AaronTovo »

The documentation for hasValue() lists 'Ext.util.Region region' as the 2nd parameter: https://bryntum.com/products/siesta/docs ... d-hasValue

In siesta-1.0.8-lite this comes from
Role('Siesta.Test.ExtJS.FormField', {
    
    methods : {
        /**
         * Passes if the passed Field has the expected value.
         * 
         * @param {Ext.Element} field The field
         * @param {Ext.util.Region} region The region to compare to.
         * @param {String} description The description of the assertion
         */
        hasValue : function(field, value, description) {
            this.is(field.getValue(), value, description);
        }
    }
});

Post by AaronTovo »

Jakub,
I'm using siesta-1.0.8-trial (and -lite does the same thing). Maybe it's fixed in 1.1?

This is minor so I won't spend much time on it. I just wanted to let you know.

Post by mats »

The hasValue method is renamed now, to fieldHasValue with correct docs.

Post Reply