fix(test): give Ui.Tests task seeds a unique Number
The task-numbers slice added a UNIQUE index on tasks.number. Ui.Tests seed TaskEntity rows directly instead of going through TaskRepository, so every row kept the default Number = 0 and 31 tests failed with 'UNIQUE constraint failed: tasks.number'.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace ClaudeDo.Ui.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Tests seed <see cref="ClaudeDo.Data.Models.TaskEntity"/> rows directly instead of going through
|
||||
/// TaskRepository, so nothing allocates their Number — and every row would default to 0, colliding
|
||||
/// on the unique index. Hand out a process-wide unique number instead.
|
||||
/// </summary>
|
||||
internal static class TestTaskNumbers
|
||||
{
|
||||
private static int _next;
|
||||
|
||||
public static int Next() => Interlocked.Increment(ref _next);
|
||||
}
|
||||
Reference in New Issue
Block a user