test($animate): ensure that pin() arguments are elements

This commit is contained in:
Martin Staffa
2015-12-10 13:25:41 +01:00
parent bc41ad8aa8
commit 6428ed5bb5
+18 -1
View File
@@ -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>');