Files
allmende/cmd/node/login_test.go
T
nilsandClaude Sonnet 5.5 8edae3ae56 Add owner inbox UI with address release
Web: "My listings" (listings, requests of a listing, conversation) in
three panes on wide screens and one at a time on phones, and a sheet or
dialog to release the exact address. Sign-in uses a link printed by
`node run` (token in the URL fragment, kept in sessionStorage only).

API: GET /api/v1/mine (own listings with request counts and whether an
address is saved); inbox rows gain last_dir, needs_reply, preview,
effort and grant_until, and can be filtered by listing.

Docs: PROTOCOL.md and README describe the owner UI and login.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 20:02:51 +01:00

18 lines
542 B
Go

package main
import "testing"
func TestLoginURL(t *testing.T) {
for addr, want := range map[string]string{
"127.0.0.1:8080": "http://127.0.0.1:8080/#/login/tok",
"0.0.0.0:8080": "http://127.0.0.1:8080/#/login/tok", // a wildcard cannot be opened
"[::]:9000": "http://127.0.0.1:9000/#/login/tok",
"[::1]:8080": "http://[::1]:8080/#/login/tok",
"192.0.2.7:80": "http://192.0.2.7:80/#/login/tok",
} {
if got := loginURL(addr, "tok"); got != want {
t.Errorf("loginURL(%q) = %q, want %q", addr, got, want)
}
}
}