mirror of
https://github.com/nasa/openmct.git
synced 2025-04-23 10:23:43 +00:00
[Build] Remove/qualify for-in usages
This commit is contained in:
parent
fb56b3ad56
commit
134452582c
platform
commonUI/edit/src/capabilities
search
@ -24,7 +24,7 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
|
||||
/*jshint forin:false */
|
||||
/**
|
||||
* Wrapper for both "context" and "composition" capabilities;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
|
@ -90,12 +90,10 @@ define(function () {
|
||||
|
||||
// For documentation, see checkAll below
|
||||
function checkAll() {
|
||||
var type;
|
||||
|
||||
// Reset all the other options to original/default position
|
||||
for (type in $scope.ngModel.checked) {
|
||||
Object.keys($scope.ngModel.checked).forEach(function (type) {
|
||||
$scope.ngModel.checked[type] = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Change the filters string depending on checkAll status
|
||||
if ($scope.ngModel.checkAll) {
|
||||
|
@ -87,24 +87,20 @@ define(
|
||||
});
|
||||
|
||||
it("checking checkAll option resets other options", function () {
|
||||
var type;
|
||||
|
||||
mockScope.ngModel.checked['mock.type.1'] = true;
|
||||
mockScope.ngModel.checked['mock.type.2'] = true;
|
||||
|
||||
controller.checkAll();
|
||||
|
||||
for (type in mockScope.ngModel.checked) {
|
||||
|
||||
Object.keys(mockScope.ngModel.checked).forEach(function (type) {
|
||||
expect(mockScope.ngModel.checked[type]).toBeFalsy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("tells the user when no options are checked", function () {
|
||||
var type;
|
||||
|
||||
for (type in mockScope.ngModel.checked) {
|
||||
Object.keys(mockScope.ngModel.checked).forEach(function (type) {
|
||||
mockScope.ngModel.checked[type] = false;
|
||||
}
|
||||
});
|
||||
mockScope.ngModel.checkAll = false;
|
||||
|
||||
controller.updateOptions();
|
||||
@ -113,12 +109,10 @@ define(
|
||||
});
|
||||
|
||||
it("tells the user when options are checked", function () {
|
||||
var type;
|
||||
|
||||
mockScope.ngModel.checkAll = false;
|
||||
for (type in mockScope.ngModel.checked) {
|
||||
Object.keys(mockScope.ngModel.checked).forEach(function (type) {
|
||||
mockScope.ngModel.checked[type] = true;
|
||||
}
|
||||
});
|
||||
|
||||
controller.updateOptions();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user