We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34065fe commit b7d5048Copy full SHA for b7d5048
tests/unit/onyxTest.ts
@@ -58,8 +58,11 @@ describe('Onyx', () => {
58
})
59
.then((keys) => {
60
expect(keys.has(ONYX_KEYS.OTHER_TEST)).toBe(false);
61
- })
62
- // Expect to reset to initial key value when calling Onyx.clear()
+ }));
+
63
+ it('should restore a key with initial state if the key was set to null and Onyx.clear() is called', () =>
64
+ Onyx.set(ONYX_KEYS.OTHER_TEST, 42)
65
+ .then(() => Onyx.set(ONYX_KEYS.OTHER_TEST, null))
66
.then(() => Onyx.clear())
67
.then(() => {
68
expect(cache.get(ONYX_KEYS.OTHER_TEST)).toBe(42);
0 commit comments