Thunk Removal Proof-of-concept (#98)

This commit is contained in:
Ben Warzeski
2023-01-19 10:13:48 -05:00
committed by GitHub
parent 82268b4f37
commit b2e8621e5c
115 changed files with 1409 additions and 1601 deletions

16
src/hooks/utils.test.js Normal file
View File

@@ -0,0 +1,16 @@
import * as utils from './utils';
jest.unmock('./utils');
describe('app-level hooks', () => {
describe('useValuecallback', () => {
it('returns react callback with event target value', () => {
const cb = val => ({ cb: val });
const prereqs = ['test', 'prereqs'];
const value = 'test-value';
const out = utils.useValueCallback(cb, prereqs);
expect(out.useCallback.cb({ target: { value } })).toEqual({ cb: value });
expect(out.useCallback.prereqs).toEqual(prereqs);
});
});
});