fix(work): mark interrupted tasks red independently of reply delivery

This commit is contained in:
ex_tianzy
2026-11-12 16:21:10 +08:00
parent a33ce02fa6
commit 43e7b97c0f
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -124,6 +124,16 @@ def test_text_delivery_never_claims_attachments_delivered():
assert '已发送1件,待投递1件,异常或待核对1件' in mixed
@pytest.mark.parametrize('state,color',[
('running','blue'),('waiting_for_approval','orange'),('unknown','orange'),
('completed','green'),('failed','red'),('interrupted','red')])
def test_execution_color_is_independent_of_text_delivery(state,color):
card=card_content('synthetic',state,'replied',[])
assert card['header']['template']==color
if state=='interrupted':
assert '已中断' in json.dumps(card,ensure_ascii=False)
async def test_card_uses_task_bound_source_and_skips_foreign_and_expired(env,monkeypatch):
task(env);cards,calls,clock=setup_cards(env,monkeypatch)
with env['store'].db: