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:
@@ -108,12 +108,14 @@ public class DetailsIslandPlanningTests : IDisposable
|
||||
ctx.Lists.Add(new ListEntity { Id = listId, Name = "L", CreatedAt = DateTime.UtcNow });
|
||||
ctx.Tasks.Add(new TaskEntity
|
||||
{
|
||||
Number = TestTaskNumbers.Next(),
|
||||
Id = parentId, ListId = listId, Title = "Parent",
|
||||
Status = TaskStatus.Idle, PlanningPhase = PlanningPhase.Active,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
});
|
||||
ctx.Tasks.Add(new TaskEntity
|
||||
{
|
||||
Number = TestTaskNumbers.Next(),
|
||||
Id = childId, ListId = listId, Title = "Child",
|
||||
Status = TaskStatus.Done, ParentTaskId = parentId, CreatedAt = DateTime.UtcNow,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user