Skip to content

Commit

Permalink
separated test
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Jul 31, 2024
1 parent 34065fe commit b7d5048
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit/onyxTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ describe('Onyx', () => {
})
.then((keys) => {
expect(keys.has(ONYX_KEYS.OTHER_TEST)).toBe(false);
})
// Expect to reset to initial key value when calling Onyx.clear()
}));

it('should restore a key with initial state if the key was set to null and Onyx.clear() is called', () =>
Onyx.set(ONYX_KEYS.OTHER_TEST, 42)
.then(() => Onyx.set(ONYX_KEYS.OTHER_TEST, null))
.then(() => Onyx.clear())
.then(() => {
expect(cache.get(ONYX_KEYS.OTHER_TEST)).toBe(42);
Expand Down

0 comments on commit b7d5048

Please sign in to comment.