mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
[Build] Inject window to satisfy JSHint
This commit is contained in:
parent
6289fe333b
commit
f380e43219
@ -38,6 +38,7 @@ define([
|
|||||||
"type": "provider",
|
"type": "provider",
|
||||||
"implementation": LocalStoragePersistenceProvider,
|
"implementation": LocalStoragePersistenceProvider,
|
||||||
"depends": [
|
"depends": [
|
||||||
|
"$window",
|
||||||
"$q",
|
"$q",
|
||||||
"PERSISTENCE_SPACE"
|
"PERSISTENCE_SPACE"
|
||||||
]
|
]
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
define(
|
define(
|
||||||
[],
|
[],
|
||||||
function () {
|
function () {
|
||||||
@ -36,11 +35,11 @@ define(
|
|||||||
* @param $interval Angular's $interval service
|
* @param $interval Angular's $interval service
|
||||||
* @param {string} space the name of the persistence space being served
|
* @param {string} space the name of the persistence space being served
|
||||||
*/
|
*/
|
||||||
function LocalStoragePersistenceProvider($q, space) {
|
function LocalStoragePersistenceProvider($window, $q, space) {
|
||||||
this.$q = $q;
|
this.$q = $q;
|
||||||
this.space = space;
|
this.space = space;
|
||||||
this.spaces = space ? [space] : [];
|
this.spaces = space ? [space] : [];
|
||||||
this.localStorage = window.localStorage;
|
this.localStorage = $window.localStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,14 +49,11 @@ define(
|
|||||||
mockQ.when.andCallFake(mockPromise);
|
mockQ.when.andCallFake(mockPromise);
|
||||||
|
|
||||||
provider = new LocalStoragePersistenceProvider(
|
provider = new LocalStoragePersistenceProvider(
|
||||||
|
{ localStorage: testLocalStorage },
|
||||||
mockQ,
|
mockQ,
|
||||||
testSpace,
|
testSpace,
|
||||||
testLocalStorage
|
testLocalStorage
|
||||||
);
|
);
|
||||||
|
|
||||||
// White-boxy: Can't effectively mock window.localStorage,
|
|
||||||
// so override the provider's local reference to it.
|
|
||||||
provider.localStorage = testLocalStorage;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reports available spaces", function () {
|
it("reports available spaces", function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user