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()); + } }