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

Commit c31270c

Browse files
committed
test($animate): ensure that pin() arguments are elements
1 parent 193153c commit c31270c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/ngAnimate/animateSpec.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,24 @@ describe("animations", function() {
14081408
});
14091409
}));
14101410

1411-
it('should allow an element to pinned elsewhere and still be available in animations',
1411+
it('should throw if the arguments are not elements',
1412+
inject(function($animate, $compile, $document, $rootScope, $rootElement) {
1413+
1414+
var element = jqLite('<div></div>');
1415+
1416+
expect(function() {
1417+
$animate.pin(element);
1418+
}).toThrowMinErr('ng', 'areq', 'Argument \'parentElement\' is not an element');
1419+
1420+
expect(function() {
1421+
$animate.pin(null, $rootElement);
1422+
}).toThrowMinErr('ng', 'areq', 'Argument \'element\' is not an element');
1423+
1424+
dealoc(element);
1425+
}));
1426+
1427+
1428+
it('should allow an element to be pinned elsewhere and still be available in animations',
14121429
inject(function($animate, $compile, $document, $rootElement, $rootScope) {
14131430

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

0 commit comments

Comments
 (0)