Skip to content

Instantly share code, notes, and snippets.

@klodoma
Last active September 9, 2019 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klodoma/500b3aa7f544f0fd0adba64af8867ac7 to your computer and use it in GitHub Desktop.
Save klodoma/500b3aa7f544f0fd0adba64af8867ac7 to your computer and use it in GitHub Desktop.
StartTest(function (t) {
let view = Ext.create({
xtype: 'list',
itemTpl: '{title}',
plugins: [{
type: 'pullrefresh',
mergeData: false
}, {
type: 'listpaging',
autoPaging: true
}, {
type: 'listswiper',
defaults: {
ui: 'action'
},
left: [{
iconCls: 'x-fa fa-phone',
text: 'Call',
commit: 'onCall'
}],
right: [{
iconCls: 'x-fa fa-envelope',
ui: 'alt confirm',
text: 'Message',
commit: 'onMessage'
}, {
iconCls: 'x-fa fa-gear',
text: 'Gear',
commit: 'onGear'
}]
}],
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
});
Ext.Viewport.add(view);
t.pass('View could be rendered');
t.chain({
waitForEvent: [view, 'childtap'],
trigger: { click: '.x-listitem:contains(Item 2)' }
},{
waitForEvent: [view, 'childdoubletap'],
trigger: { doubleClick: '.x-listitem:contains(Item 2)' }
},{
waitForEvent: [view, 'childdoubletap'],
trigger: { doubleTap: '.x-listitem:contains(Item 2)' },
timeout: 1000
},{
waitForEvent: [view, 'childlongpress'],
trigger: { longPress: '.x-listitem:contains(Item 2)' },
timeout: 1000
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment