Skip to content

Commit 200985e

Browse files
committed
test($animate): ensure that pin() arguments are elements
1 parent f470917 commit 200985e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/ngAnimate/animateSpec.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,24 @@ describe("animations", function() {
14311431
});
14321432
}));
14331433

1434-
it('should allow an element to pinned elsewhere and still be available in animations',
1434+
it('should throw if the arguments are not elements',
1435+
inject(function($animate, $compile, $document, $rootScope, $rootElement) {
1436+
1437+
var element = jqLite('<div></div>');
1438+
1439+
expect(function() {
1440+
$animate.pin(element);
1441+
}).toThrowMinErr('ng', 'areq', 'Argument \'parentElement\' is not an element');
1442+
1443+
expect(function() {
1444+
$animate.pin(null, $rootElement);
1445+
}).toThrowMinErr('ng', 'areq', 'Argument \'element\' is not an element');
1446+
1447+
dealoc(element);
1448+
}));
1449+
1450+
1451+
it('should allow an element to be pinned elsewhere and still be available in animations',
14351452
inject(function($animate, $compile, $document, $rootElement, $rootScope) {
14361453

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

0 commit comments

Comments
 (0)