Get help with testing, discuss unit testing strategies etc.


Post by Gustav »

Hello!

Not sure if a bug or desired behaviour (as it seems from the Doc).

I tried to write a unit test for this bug:
https://www.sencha.com/forum/showthread ... ost1103867
Fiddle: https://fiddle.sencha.com/#fiddle/od1 (right click on the link (important!) and then on delete on all four entries => last enry throws Exception)


The bug can only be reproduced/tested by right clicking exactly on the link, if you right click anywhere else in the cell, it works just fine.

So I tried to test it with the following code, but whatever I tried I couldn't get it to work. My right click is always done on the td not the a. Any suggestions?
t.livesOk(function() {
    var chain = [];
    for (var i = 0; i<4; i++) {
        chain.push({
            rightClick: 'a'
        }, {
            click: '>> #delete'
        });
    }
    
    chain.push(function() {
        t.isStoreEmpty(grid.getStore(), 'Grid store is empty after removing all four entries');
    });
    
    t.chain(chain);
    
    
}, 'Removing all grid entries by context menu throws no exception');

Post by nickolay »

I think the click is done on <a>, its just some difference between the real/simulated events and related focus handling. Hard to emulate the browser behavior 100%, we'll support it with native events (on the roadmap).

Post Reply