From e9b39df3226a14005071496dbe501835936325f7 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 7 Jul 2026 12:05:03 +0000 Subject: [PATCH] =?UTF-8?q?Filters=20that=20match=20no=20properties=20refu?= =?UTF-8?q?se=20the=20run=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../app/modelling/test_trigger_run_router.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/backend/app/modelling/test_trigger_run_router.py b/tests/backend/app/modelling/test_trigger_run_router.py index d383fae1d..9da1405f2 100644 --- a/tests/backend/app/modelling/test_trigger_run_router.py +++ b/tests/backend/app/modelling/test_trigger_run_router.py @@ -114,6 +114,23 @@ def test_trigger_run_rejects_a_task_that_already_has_subtasks(api: Api) -> None: assert len(api.subtasks_for(task)) == 1 +def test_trigger_run_rejects_filters_that_match_no_properties(api: Api) -> None: + """Zero resolved properties is a caller error (ADR-0055): a task with no + sub_tasks could never roll up to complete, and the app's preview shows the + same zero from the same rule before POSTing.""" + # arrange — a portfolio with no properties at all + task = api.seed_task() + scenario = api.seed_scenario() + + # act + response = _trigger(api, task, [scenario]) + + # assert + assert response.status_code == 400 + assert api.sent_bodies == [] + assert api.subtasks_for(task) == [] + + def test_trigger_run_fans_out_one_subtask_and_message_per_scenario_batch( api: Api, ) -> None: