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

@@ -179,14 +179,27 @@
(let ((result (backend-cascade-call "Say hello" :system-prompt "Be brief.")))
(is (stringp result) "Expected string response, got: ~a" result)))))
(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))))
(test test-flight-plan-message-format
"Contract Phase3: dispatcher-flight-plan-create returns valid message."