tests: close remaining contract gaps (action-dispatch, org-headline-add/find-by-id, tangle-sync, create-note, messaging-link/unlink)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 5s

This commit is contained in:
2026-05-05 13:52:59 -04:00
parent 3d237e9c78
commit ad8242fee6
12 changed files with 150 additions and 22 deletions

View File

@@ -272,19 +272,32 @@ credentials. Skipped silently if OPENROUTER_API_KEY is unset.
* Messaging Link/Unlink
Verifies messaging-link stores a token in the vault, and
gateway-configured-p returns the correct status. Gated on
TELEGRAM_BOT_TOKEN.
Verifies messaging-link stores a token in the vault, gateway-configured-p
returns the correct status, and messaging-unlink removes it. No real
API credentials needed — these are management functions.
#+begin_src lisp
(test test-messaging-link
"Contract Phase2: messaging-link stores token and gateway-configured-p returns T."
(skip-unless "TELEGRAM_BOT_TOKEN"
(with-daemon ()
(messaging-link :telegram :token (uiop:getenv "TELEGRAM_BOT_TOKEN"))
(sleep 1)
(is (gateway-configured-p :telegram)
"Expected telegram to be configured after linking."))))
(test test-messaging-link-unlink
"Contract Phase2: messaging-link stores token, configured-p returns T, unlink removes it."
(with-daemon ()
(messaging-link :test-platform :token "fake-token-123")
(is (gateway-configured-p :test-platform)
"Expected test-platform to be configured after linking")
(messaging-unlink :test-platform)
(is (not (gateway-configured-p :test-platform))
"Expected test-platform to be unconfigured after unlinking")))
(test test-gateway-configured-p-false
"Contract Phase2: gateway-configured-p returns nil for unknown platform."
(with-daemon ()
(is (not (gateway-configured-p :nonexistent-platform-xyz)))))
(test test-gateway-start-messaging
"Contract Phase2: gateway registry initializes with expected platforms."
(with-daemon ()
(gateway-registry-initialize)
(is (hash-table-p passepartout::*gateway-registry*))
(is (>= (hash-table-count passepartout::*gateway-registry*) 1))))
#+end_src
* TUI Integration Shell Script