({ code }: { code: ApiError })
| 1071 | |
| 1072 | describe('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(); |
nothing calls this directly
no outgoing calls
no test coverage detected