Files
danyang-match/tests/miniapp/matchmaker_service_confirmation_contract_test.py
T
WorkBuddy 3c2b967274
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s
release: freeze 2026-10-15 validated release baseline
2026-10-15 09:47:31 +08:00

27 lines
1.4 KiB
Python

from pathlib import Path
import unittest
ROOT = Path(__file__).parents[2]
class MatchmakerServiceConfirmationContractTest(unittest.TestCase):
def test_backend_exposes_user_confirmation_and_writes_in_service(self):
controller = (ROOT / "backend/src/main/java/com/danyang/match/platform/matchmaker/controller/MatchmakerController.java").read_text(encoding="utf-8")
service = (ROOT / "backend/src/main/java/com/danyang/match/platform/matchmaker/service/MatchmakerService.java").read_text(encoding="utf-8")
mapper = (ROOT / "backend/src/main/java/com/danyang/match/platform/matchmaker/mapper/MatchmakerServiceMapper.java").read_text(encoding="utf-8")
self.assertIn('@PostMapping("/services/{id}/confirm")', controller)
self.assertIn("confirmService(id, principal.id())", controller)
self.assertIn("confirmWaitingForUser", mapper)
def test_progress_page_only_offers_confirmation_for_waiting_user(self):
source = (ROOT / "miniapp/pages/matchmaker-progress/matchmaker-progress.js").read_text(encoding="utf-8")
wxml = (ROOT / "miniapp/pages/matchmaker-progress/matchmaker-progress.wxml").read_text(encoding="utf-8")
self.assertIn("confirmService", source)
self.assertIn("this.data.service.status !== 'waiting_user'", source)
self.assertIn("bindtap=\"onConfirmService\"", wxml)
if __name__ == "__main__":
unittest.main()