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: