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) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 11:20:43 +02:00
parent 1f1c944a8b
commit 345191b1df

View File

@@ -46,4 +46,19 @@ public class WerkbakTests
Assert.Empty(await werkbak.GetAsync()); 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());
}
} }