mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -22,10 +22,12 @@ describe('bar directives', function() {
|
||||
});
|
||||
spyOn(ionic, 'off');
|
||||
var el = setup();
|
||||
expect(ionic.on).toHaveBeenCalledWith('tap', jasmine.any(Function), el[0]);
|
||||
expect(ionic.on.mostRecentCall.args[0]).toBe('tap');
|
||||
expect(ionic.off).not.toHaveBeenCalled();
|
||||
el.scope().$destroy();
|
||||
expect(ionic.off).toHaveBeenCalledWith('tap', callback, el[0]);
|
||||
expect(ionic.off.mostRecentCall.args[0]).toBe('tap');
|
||||
expect(ionic.off.mostRecentCall.args[1]).toBe(callback);
|
||||
expect(ionic.off.mostRecentCall.args[2]).toBe(el[0]);
|
||||
});
|
||||
['input','textarea','select'].forEach(function(tag) {
|
||||
it('should ignore tap if it\'s in a ' + tag, function() {
|
||||
|
||||
@@ -525,14 +525,17 @@ describe('collectionRepeatManager service', function() {
|
||||
it('should attachItem and set the element transform', function() {
|
||||
var manager = setup();
|
||||
var item = {
|
||||
element: [{ style: {} }]
|
||||
element: angular.element('<div>')
|
||||
};
|
||||
spyOn(item.element, 'css');
|
||||
spyOn(manager.dataSource, 'getItem').andReturn(item);
|
||||
spyOn(manager.dataSource, 'attachItem');
|
||||
manager.renderItem(0, 33, 44);
|
||||
expect(manager.dataSource.attachItem).toHaveBeenCalledWith(item);
|
||||
expect(item.element[0].style[ionic.CSS.TRANSFORM])
|
||||
.toEqual(manager.transformString(33, 44));
|
||||
expect(item.element.css).toHaveBeenCalledWith(
|
||||
ionic.CSS.TRANSFORM,
|
||||
manager.transformString(33, 44)
|
||||
);
|
||||
expect(manager.renderedItems[0]).toBe(item);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user