修复(履约绑定): 匹配客户目标时展示 cjm 待确认角色
This commit is contained in:
@@ -730,6 +730,49 @@ def test_result_rejects_legacy_role_when_action_alias_still_has_role():
|
||||
assert pending_binding_role_from_result(result) == ""
|
||||
|
||||
|
||||
def test_result_accepts_legacy_role_matching_customer_target():
|
||||
candidates = [
|
||||
_role_candidate(LEGACY_ALIAS, "情绪稳妥"),
|
||||
_role_candidate(ACT_ALIAS, "呆혹", bound_act=True),
|
||||
]
|
||||
result = {
|
||||
"role_name": "情绪稳妥",
|
||||
"act_alias": LEGACY_ALIAS,
|
||||
"action_act_aliases": [ACT_ALIAS],
|
||||
"baseline_role_name": "呆혹",
|
||||
"baseline_is_bound_act": True,
|
||||
"expected_role_name": "情绪稳妥",
|
||||
"bind_ready_for_confirm": True,
|
||||
"bind_confirmed": False,
|
||||
"bind_candidates": [
|
||||
{
|
||||
"act_alias": LEGACY_ALIAS,
|
||||
"role_name": "情绪稳妥",
|
||||
"is_bound_act": False,
|
||||
},
|
||||
{
|
||||
"act_alias": ACT_ALIAS,
|
||||
"role_name": "呆혹",
|
||||
"is_bound_act": True,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
assert pending_binding_role_from_result(result) == "情绪稳妥"
|
||||
decisions = _RolePicker()._binding_candidate_decisions(
|
||||
candidates,
|
||||
baseline_role_name="呆혹",
|
||||
baseline_is_bound_act=True,
|
||||
actionable_aliases=[ACT_ALIAS],
|
||||
expected_role_name="情绪稳妥",
|
||||
)
|
||||
legacy_decision = next(
|
||||
item for item in decisions if item["alias"] == LEGACY_ALIAS
|
||||
)
|
||||
assert legacy_decision["confirmable"] is True
|
||||
assert legacy_decision["reason"] == "role_changed"
|
||||
|
||||
|
||||
def test_expected_role_never_falls_back_to_old_activity_role():
|
||||
old_role = "狗鼻子弗尼亚bd"
|
||||
new_role = "我是火星人2222"
|
||||
|
||||
Reference in New Issue
Block a user