feat(worker): MCP tools update_planning_task and finalize
This commit is contained in:
@@ -104,4 +104,31 @@ public sealed class PlanningMcpServiceTests : IDisposable
|
||||
|
||||
Assert.Null(await _tasks.GetByIdAsync(c.Id));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdatePlanningTask_SetsTitleAndDescription()
|
||||
{
|
||||
var parent = await SeedPlanningParentAsync();
|
||||
|
||||
await _sut.UpdatePlanningTask(Ctx(parent.Id), "new title", "new desc", CancellationToken.None);
|
||||
|
||||
var loaded = await _tasks.GetByIdAsync(parent.Id);
|
||||
Assert.Equal("new title", loaded!.Title);
|
||||
Assert.Equal("new desc", loaded.Description);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Finalize_PromotesDraftsAndInvalidatesToken()
|
||||
{
|
||||
var parent = await SeedPlanningParentAsync();
|
||||
await _tasks.CreateChildAsync(parent.Id, "c1", null, null, null);
|
||||
await _tasks.CreateChildAsync(parent.Id, "c2", null, null, null);
|
||||
|
||||
var count = await _sut.Finalize(Ctx(parent.Id), true, CancellationToken.None);
|
||||
|
||||
Assert.Equal(2, count);
|
||||
var loaded = await _tasks.GetByIdAsync(parent.Id);
|
||||
Assert.Equal(TaskStatus.Planned, loaded!.Status);
|
||||
Assert.Null(loaded.PlanningSessionToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user