from pathlib import Path import unittest ROOT = Path(__file__).parents[2] class MatchmakerReferralTaskContractTest(unittest.TestCase): def test_workbench_loads_operator_referral_history(self): source = (ROOT / "miniapp/pages/matchmaker-workbench/matchmaker-workbench.js").read_text(encoding="utf-8") wxml = (ROOT / "miniapp/pages/matchmaker-workbench/matchmaker-workbench.wxml").read_text(encoding="utf-8") self.assertIn("/referrals/operator/history", source) self.assertIn("referralTasks", source) self.assertIn("referralTasks.length", wxml) self.assertIn("{{item.statusLabel}}", wxml) self.assertIn("{{item.targetLabel}}", wxml) self.assertIn("查看详情", wxml) self.assertIn("发起转介", wxml) self.assertIn("/referrals/activity", source) self.assertIn("/referrals/service-station", source) self.assertIn("/operator/matchmaker/recommendations", source) self.assertIn("推荐进展", wxml) self.assertNotIn("matchStore.like", source) self.assertNotIn("matchStore.pass", source) self.assertNotIn("emergencyContactPhone", source) if __name__ == "__main__": unittest.main()