ng-infinite-autocomplete
Advanced tools
Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "ng-infinite-autocomplete", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "AngularJS 1.x infinite-autocomplete wrapper", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -101,2 +101,3 @@ import * as angular from 'angular'; | ||
scope.$on(`$destroy`, () => { | ||
console.dir(inifinityAutocomplete); | ||
fetchSizeWatchListener(); | ||
@@ -107,2 +108,3 @@ maxHeightWatchListener(); | ||
customizedOptionsListener(); | ||
inifinityAutocomplete.destroy(); | ||
}); | ||
@@ -109,0 +111,0 @@ |
@@ -11,2 +11,3 @@ import * as angular from 'angular'; | ||
InfiniteAutocompleteCore = jasmine.createSpy('InfiniteAutocompleteCore'); | ||
InfiniteAutocompleteCore.prototype.destroy = jasmine.createSpy('destroy'); | ||
InfiniteAutocompleteCore.prototype.setConfig = jasmine.createSpy('setConfig') | ||
@@ -46,3 +47,21 @@ //Mock passed functions to be executed automatically to bypass low coverage report | ||
describe(`destroy lifecycle hook`, function() { | ||
it(`should call InfiniteAutocompleteCore.prototype.destroy when scope get destroy`, | ||
function() { | ||
$scope.data = [{ | ||
text: 'text', value: 'value' | ||
}]; | ||
element = $compile('<div ng-infinite-autocomplete data="data"></div>')($scope); | ||
$scope.$digest(); | ||
expect(InfiniteAutocompleteCore) | ||
.toHaveBeenCalledWith(element[0]); | ||
$scope.$destroy(); | ||
expect(InfiniteAutocompleteCore.prototype.destroy) | ||
.toHaveBeenCalled(); | ||
}); | ||
}); | ||
describe(`Data feature support`, function() { | ||
@@ -49,0 +68,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36226
594