mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
test: update case wording
This commit is contained in:
parent
86489d7f2b
commit
6d5624eee2
@ -36,7 +36,7 @@ describe('useCopyToClipboard', () => {
|
||||
expect(state.error).not.toBeDefined();
|
||||
});
|
||||
|
||||
it('should only call writeText if passed a valid input and set state', () => {
|
||||
it('should not call writeText if passed an invalid input and set state', () => {
|
||||
const testValue = {}; // invalid value
|
||||
let [state, copyToClipboard] = hook.result.current;
|
||||
act(() => copyToClipboard(testValue));
|
||||
@ -58,6 +58,7 @@ describe('useCopyToClipboard', () => {
|
||||
expect(state.noUserInteraction).not.toBeDefined();
|
||||
expect(state.error).toStrictEqual(new Error(valueToRaiseMockException));
|
||||
});
|
||||
|
||||
it('should return initial state while unmounted', () => {
|
||||
hook.unmount();
|
||||
const [state, copyToClipboard] = hook.result.current;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user