Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
test($animate): ensure that pin() arguments are elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Narretz committed Dec 10, 2015
1 parent f470917 commit 200985e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,24 @@ describe("animations", function() {
});
}));

it('should allow an element to pinned elsewhere and still be available in animations',
it('should throw if the arguments are not elements',
inject(function($animate, $compile, $document, $rootScope, $rootElement) {

var element = jqLite('<div></div>');

expect(function() {
$animate.pin(element);
}).toThrowMinErr('ng', 'areq', 'Argument \'parentElement\' is not an element');

expect(function() {
$animate.pin(null, $rootElement);
}).toThrowMinErr('ng', 'areq', 'Argument \'element\' is not an element');

dealoc(element);
}));


it('should allow an element to be pinned elsewhere and still be available in animations',
inject(function($animate, $compile, $document, $rootElement, $rootScope) {

var innerParent = jqLite('<div></div>');
Expand Down

0 comments on commit 200985e

Please sign in to comment.