From 345191b1dfb787c6e1762008ffb5f10f62102da1 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Thu, 16 Jul 2026 11:20:43 +0200 Subject: [PATCH] test(domain): the werkbak drops a registration that is no longer open (refs #12) A withdrawn registration may keep a lingering Beoordelen task until the workflow cancels it; the werkbak must list only registrations still open for beoordeling, so it drops off. Co-Authored-By: Claude Opus 4.8 (1M context) --- services/domain/Big.Tests/WerkbakTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/domain/Big.Tests/WerkbakTests.cs b/services/domain/Big.Tests/WerkbakTests.cs index bfbf182..0b3bdcf 100644 --- a/services/domain/Big.Tests/WerkbakTests.cs +++ b/services/domain/Big.Tests/WerkbakTests.cs @@ -46,4 +46,19 @@ public class WerkbakTests Assert.Empty(await werkbak.GetAsync()); } + + [Fact] + public async Task Skips_a_task_whose_registration_is_no_longer_open() + { + // A withdrawn registration (S-11) may still have a Beoordelen task lingering until the workflow + // cancels it; the werkbak lists only registrations still open for beoordeling, so it drops off. + var store = new FakeRegistrationStore(); + var registration = Registration.Submit("123456782"); + registration.Withdraw(); + store.Seed(registration); + var tasks = new FakeUserTaskClient([new BeoordelingTask("task-1", registration.Id)]); + var werkbak = new Werkbak(tasks, store); + + Assert.Empty(await werkbak.GetAsync()); + } }