mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
[Persistence] Add test case
Add test case for cache to ensure the same object instance is given for multiple read calls, as this addresses WTD-791.
This commit is contained in:
parent
014fca0494
commit
301d46e60b
@ -77,6 +77,17 @@ define(
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("gives a single instance of cached objects", function () {
|
||||||
|
// Perform two reads
|
||||||
|
decorator.readObject(testSpace, "someKey", "someValue")
|
||||||
|
.then(mockCallback);
|
||||||
|
decorator.readObject(testSpace, "someKey", "someValue")
|
||||||
|
.then(mockCallback);
|
||||||
|
|
||||||
|
// Results should have been pointer-identical
|
||||||
|
expect(mockCallback.calls[0].args[0])
|
||||||
|
.toBe(mockCallback.calls[1].args[0]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user