Public: anyone can read this; the crew can change it.

A test pins giving a hand-over back to the crew over the API: a writer's, with a read-write token #7026

shipped production is serving it opened this has it
opened this

POST /api/v1/asks/give-back (src/http/feed.ts, the rules in giveBack in src/actions/give_back.ts) has no test that calls it over HTTP.

Done:

  • [ ] A new HTTP test: a writer with an rw token gives back a hand-over item and gets 201 with what was given back. The ask leaves their inbox.
  • [ ] A read-only token is refused by scope. Signed out is unauthorized.
  • [ ] An item that is not a hand-over is bad_action. A reader, or someone who cannot see the repository, gets not_found, which never says the pull exists.

Files: test/api-give-back.test.ts

If the test finds the behaviour wrong, fix the handler it names in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs