test: update test for userStateWithHistory

This commit is contained in:
Qingqi Shi 2020-12-06 14:54:01 +00:00
parent fca687d32c
commit 015d491ce7
No known key found for this signature in database
GPG Key ID: A6739A6B184DB416

View File

@ -52,9 +52,9 @@ describe('useStateWithHistory', () => {
});
expect(hook.result.current[0][0]).toBe(321);
act(() => {
hook.result.current[0][1](() => 111);
hook.result.current[0][1]((current) => (current ?? 0) + 111);
});
expect(hook.result.current[0][0]).toBe(111);
expect(hook.result.current[0][0]).toBe(432);
});
it('should receive initial history', () => {