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

fix(tooltip): memory leak on show/hide #2919

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/popover/test/popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ describe('popover', function() {
var elm,
elmBody,
scope,
elmScope;
elmScope,
tooltipScope;

// load the popover code
beforeEach(module('ui.bootstrap.popover'));
Expand All @@ -20,10 +21,11 @@ describe('popover', function() {
scope.$digest();
elm = elmBody.find('span');
elmScope = elm.scope();
tooltipScope = elmScope.$$childTail;
}));

it('should not be open initially', inject(function() {
expect( elmScope.tt_isOpen ).toBe( false );
expect( tooltipScope.isOpen ).toBe( false );

// We can only test *that* the popover-popup element wasn't created as the
// implementation is templated and replaced.
Expand All @@ -32,7 +34,7 @@ describe('popover', function() {

it('should open on click', inject(function() {
elm.trigger( 'click' );
expect( elmScope.tt_isOpen ).toBe( true );
expect( tooltipScope.isOpen ).toBe( true );

// We can only test *that* the popover-popup element was created as the
// implementation is templated and replaced.
Expand All @@ -42,7 +44,7 @@ describe('popover', function() {
it('should close on second click', inject(function() {
elm.trigger( 'click' );
elm.trigger( 'click' );
expect( elmScope.tt_isOpen ).toBe( false );
expect( tooltipScope.isOpen ).toBe( false );
}));

it('should not unbind event handlers created by other directives - issue 456', inject( function( $compile ) {
Expand Down
Loading