I think that might work - however it seems to be testing implementation details - which might be ok if your hook does nothing when aborted.
For testing with fetch I usually use something like sinon's fakeServer. You can intercept requests but not respond to it - unmount the component (or anything that triggers an abort) and check if corresponding side effects are firing (or not firing - e.g. no actions were dispatched)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think that might work - however it seems to be testing implementation details - which might be ok if your hook does nothing when aborted.
For testing with
fetch
I usually use something likesinon
's fakeServer. You can intercept requests but not respond to it - unmount the component (or anything that triggers an abort) and check if corresponding side effects are firing (or not firing - e.g. no actions were dispatched)