MCPcopy Create free account
hub / github.com/dailydotdev/apps / FailingMutation

Function FailingMutation

packages/shared/src/contexts/BootProvider.spec.tsx:1073–1088  ·  view source on GitHub ↗
({ code }: { code: ApiError })

Source from the content-addressed store, hash-verified

1071
1072describe('boot refetch on an expired token', () => {
1073 const FailingMutation = ({ code }: { code: ApiError }) => {
1074 const { mutate } = useMutation({
1075 mutationFn: () =>
1076 Promise.reject(
1077 Object.assign(new Error(code), {
1078 response: { errors: [{ extensions: { code } }] },
1079 }),
1080 ),
1081 });
1082
1083 return (
1084 <button type="button" onClick={() => mutate()}>
1085 Submit
1086 </button>
1087 );
1088 };
1089
1090 const failMutationAfterExpiry = async (code: ApiError) => {
1091 jest.mocked(getBootData).mockClear();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected