fix(popover): default values overwrites options

This commit is contained in:
Adam Bradley
2014-12-12 22:01:36 -06:00
parent c22d87755b
commit 916b276ba3
2 changed files with 19 additions and 9 deletions

View File

@@ -202,6 +202,16 @@ describe('Ionic Popover', function() {
expect(instance.scope.$parent.$broadcast).toHaveBeenCalledWith('popover.shown', instance);
});
it('should set custom options', function() {
var template = '<div class="popover"></div>';
var instance = popover.fromTemplate(template, {
animation: 'custom-animation'
});
instance.show();
timeout.flush();
expect(instance.$el[0].querySelector('.popover').classList.contains('custom-animation')).toBe(true);
});
it('should broadcast "popover.hidden" on hide with self', function() {
var template = '<div class="popover"></div>';
var instance = popover.fromTemplate(template, {});