Get help with testing, discuss unit testing strategies etc.


Post by klodoma »

I was following this tutorial to test an app which is generated with sencha cmd:
https://www.bryntum.com/blog/testing-an ... encha-cmd/

I am wondering, how can one render ONE UI View in test, or is there a best practice to render it?

view.render(Ext.getBody()) doesn't work, cause there is already a viewport in place.
StartTest( function ( t )
{
    let itemClass = 'Sc.view.component.DateTime';
    t.requireOk( itemClass, function ()
    {
        const view = Ext.create( itemClass, {
            height: 400
        } );

        view.render( 'ext-viewport' ); //????
        t.pass( "View could be rendered" );
    } );

} );
Any suggestions how to render a single view?

Post by mats »

You should not start your application when you want to test its part like you describe. Simply prevent app from starting and then you can do anything you want in the test since all code is loaded.

Post Reply