Skip to content

Commit

Permalink
test(tooltip): DOM elements cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pkozlowski-opensource committed May 4, 2014
1 parent d51c189 commit 98af6f9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/tooltip/test/tooltip.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,16 @@ describe('tooltip', function() {
});

describe( 'with an append-to-body attribute', function() {
var scope, elmBody, elm, elmScope;
var scope, elmBody, elm, elmScope, $body;

beforeEach( inject( function( $rootScope ) {
scope = $rootScope;
}));

afterEach(function () {
$body.find('.tooltip').remove();
});

it( 'should append to the body', inject( function( $compile, $document ) {
$body = $document.find( 'body' );
elmBody = angular.element(
Expand Down Expand Up @@ -473,13 +477,18 @@ describe( '$tooltipProvider', function() {
});

describe('appendToBody', function() {
// load the tooltip code

var $body;

beforeEach(module('template/tooltip/tooltip-popup.html'));
beforeEach(module('ui.bootstrap.tooltip', function ( $tooltipProvider ) {
$tooltipProvider.options({ appendToBody: true });
}));

// load the template
beforeEach(module('template/tooltip/tooltip-popup.html'));
afterEach(function () {
$body.find('.tooltip').remove();
});


it( 'should append to the body', inject( function( $rootScope, $compile, $document ) {
$body = $document.find( 'body' );
Expand Down

0 comments on commit 98af6f9

Please sign in to comment.