mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Fixed one small test
This commit is contained in:
@ -31,7 +31,8 @@ TabBarItem.prototype = {
|
||||
ionic.on('tap', this._tapHandler, this.el);
|
||||
},
|
||||
|
||||
onTap: function() {
|
||||
onTap: function(e) {
|
||||
console.log('On tap');
|
||||
},
|
||||
|
||||
// Remove the event listeners from this object
|
||||
@ -92,7 +93,6 @@ TabBar.prototype = {
|
||||
|
||||
if(!this._itemTapHandler) {
|
||||
this._itemTapHandler = function(e) {
|
||||
console.log('TAB HANDERL', e, this);
|
||||
_this.selectItem(this);
|
||||
};
|
||||
}
|
||||
|
||||
@ -51,18 +51,16 @@ describe('TabBar view', function() {
|
||||
|
||||
|
||||
it('Should handle item click event', function() {
|
||||
debugger;
|
||||
var item = items[0];
|
||||
spyOn(item, 'onTap');
|
||||
spyOn(tabBar, '_itemTapHandler');
|
||||
spyOn(tabBar, 'selectItem');
|
||||
|
||||
var event = new CustomEvent('tap', {
|
||||
target: item.el
|
||||
});
|
||||
item.el.dispatchEvent(event);
|
||||
|
||||
expect(item.onTap).toHaveBeenCalled();
|
||||
expect(tabBar._itemTapHandler).toHaveBeenCalled();
|
||||
//expect(item.onTap).toHaveBeenCalled();
|
||||
expect(tabBar.selectItem).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user