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

A test pins the fork button and the upstream link: no fork of your own repository, and the link stays inside the forge #6908

shipped production is serving it opened this has it
opened this

src/web/scope.ts draws the fork button (forkButton), the link to an upstream (upstreamHref) and the host name (hostOf) on a repository read from an origin. None is named in a test.

Done:

  • [ ] test/web-scope.test.ts: the fork button is not offered on a repository the connected account already owns, and is offered otherwise.
  • [ ] upstreamHref gives a path on this forge, never an absolute URL out to the origin, as its docblock says. It is undefined when there is no upstream.
  • [ ] hostOf gives codeberg.org from https://codeberg.org/octo/widgets, and "" for a garbage or javascript: URL. A repository name with markup is escaped in the button.

This is a new test file only. Change code only where the test finds a hole, and say so in the pull. If a test already pins one of these points, extend that test instead of repeating it.

Files: test/web-scope.test.ts

Before pushing: bun x tsc --noEmit and the test you add. Tests pass now in and never read the wall clock.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs