vikunja/veans/internal
Tink bot 98affb265a test(veans): cover bootstrap validators and prompt UX
Three helpers I added recently have no e2e coverage because the
suite always passes --bot-username with a valid name and
--yes-buckets to skip prompts.

Nine tests in a new bootstrap_test.go:

- TestValidateBotUsername — table-driven, 18 rows: valid shapes
  (bot-foo, bot-foo-bar, bot-foo123, bot-foo_bar, bot-foo.bar,
  bot-a), invalid prefix (foo, Bot-foo, ""), invalid chars
  (spaces, commas, uppercase, !, embedded space), the reserved
  link-share-N pattern, and the bare "bot-" edge.

- TestConfirmOverwriteExistingConfig — file-missing path, the
  OverwriteExistingConfig=true short-circuit, every interesting
  prompt answer (y, yes, Y, Yes, "  yes  " → proceed; n, "",
  garbage → CodeConflict with path in message; prompter error
  → CodeUnknown wrapping the original via errors.Is).

- TestBootstrapBuckets_{AllPresent,AutoApprove,PromptDeclined,
  PromptAborted,PromptUnknownCap,PromptAccepted} — drive the
  function against a stub httptest server (bucketServer helper)
  that records ListBuckets responses and CreateBucket payloads,
  with a scripted queuePrompter for the prompt-driven cases.
  Covers the alias-match short circuit, the auto-approve path,
  the new declined/aborted/retry-cap paths, and the y-accepted
  path.

Local helpers (queuePrompter for scripted answers with injectable
error; bucketServer for the stubbed bucket endpoints) stay in the
test file — no production code changes.
2026-05-27 08:21:57 +00:00
..
auth test(veans): cover bootstrap validators and prompt UX 2026-05-27 08:21:57 +00:00
bootstrap test(veans): cover bootstrap validators and prompt UX 2026-05-27 08:21:57 +00:00
client test(veans): cover client error mapping, pagination, and 404→BOT_USERS_UNAVAILABLE 2026-05-27 08:21:57 +00:00
commands test(veans): pin runUpdate's call-order invariants 2026-05-27 08:21:57 +00:00
config feat(veans): make the HTTP client timeout configurable via .veans.yml 2026-05-27 08:21:57 +00:00
credentials test(veans): cover credential-store hardening invariants 2026-05-27 08:21:57 +00:00
output test(veans): cover the stable error-envelope contract 2026-05-27 08:21:57 +00:00
status feat(veans): make the HTTP client timeout configurable via .veans.yml 2026-05-27 08:21:57 +00:00