Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
fix(macPopover): Fix mac-popover-refresh-on not registering properly
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
adrianlee44 committed Sep 13, 2016
1 parent 2ef5ce8 commit ec9e4ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ constant('macPopoverDefaults', {
footer: false,
header: false,
title: '',
direction: 'above left'
direction: 'above left',
refreshOn: ''
},
template: "<div class='mac-popover' ng-class='macPopoverClasses'>\
<div class='tip'></div>\
Expand Down
15 changes: 13 additions & 2 deletions test/unit/popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ describe("Popover directive", function() {
var element;

beforeEach(function () {
var template;
template = "<div><mac-popover id='testPopover'>Test</mac-popover></div>";
var template = "<div><mac-popover id='testPopover'>Test</mac-popover></div>";
element = $compile(template)($rootScope);
$rootScope.$digest();
});
Expand Down Expand Up @@ -49,6 +48,18 @@ describe("Popover directive", function() {
});
});

describe("popover element register", function() {
it('should register with refreshOn options', function() {
var template = "<div><mac-popover id='testPopover' mac-popover-refresh-on='testEvent'>Test</mac-popover></div>";
$compile(template)($rootScope);
$rootScope.$digest();

var testPopoverOptions = popover.registered.testPopover
expect(testPopoverOptions).toBeDefined();
expect(testPopoverOptions.refreshOn).toBe('testEvent');
});
});

describe("popover trigger", function () {
var trigger, $timeout;

Expand Down

0 comments on commit ec9e4ff

Please sign in to comment.