Skip to content

Commit b7d5048

Browse files
committed
separated test
1 parent 34065fe commit b7d5048

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/unit/onyxTest.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ describe('Onyx', () => {
5858
})
5959
.then((keys) => {
6060
expect(keys.has(ONYX_KEYS.OTHER_TEST)).toBe(false);
61-
})
62-
// Expect to reset to initial key value when calling Onyx.clear()
61+
}));
62+
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))
6366
.then(() => Onyx.clear())
6467
.then(() => {
6568
expect(cache.get(ONYX_KEYS.OTHER_TEST)).toBe(42);

0 commit comments

Comments
 (0)