refactor: Datei-Scope-Serialisierung entfernen
ScopeGlobs auf Tasks und SerializeOnFileOverlap auf der Listen-Config waren ungenutzt: der Scope wurde nie befuellt, also hat der Queue-Picker nie serialisiert. ScopeOverlap, das Picker-Gate, die DTO-Felder, die UI-Option und die Spalten fallen weg (Migration DropFileScopeSerialization).
This commit is contained in:
@@ -8,8 +8,8 @@ using Xunit;
|
||||
namespace ClaudeDo.Worker.Tests.Hub;
|
||||
|
||||
/// UpdateListConfig's "all fields blank -> delete the row" branch used to delete unconditionally,
|
||||
/// silently dropping SerializeOnFileOverlap. The DTO field is tri-state: the list-settings modal
|
||||
/// sends an explicit true/false, every other caller sends null and must not clear the stored flag.
|
||||
/// silently dropping fields the caller doesn't own. It may only delete when nothing else is stored;
|
||||
/// the preserve-the-stored-value side is covered by ListConfigTicketProjectTests.
|
||||
public sealed class ListConfigHubTests : IDisposable
|
||||
{
|
||||
private readonly DbFixture _db = new();
|
||||
@@ -42,13 +42,10 @@ public sealed class ListConfigHubTests : IDisposable
|
||||
return listId;
|
||||
}
|
||||
|
||||
private async Task SeedConfigAsync(string listId, string? model = null, bool serializeOnFileOverlap = false)
|
||||
private async Task SeedConfigAsync(string listId, string? model = null)
|
||||
{
|
||||
await using var ctx = _db.CreateContext();
|
||||
await new ListRepository(ctx).SetConfigAsync(new ListConfigEntity
|
||||
{
|
||||
ListId = listId, Model = model, SerializeOnFileOverlap = serializeOnFileOverlap,
|
||||
});
|
||||
await new ListRepository(ctx).SetConfigAsync(new ListConfigEntity { ListId = listId, Model = model });
|
||||
}
|
||||
|
||||
private async Task<ListConfigEntity?> GetConfigAsync(string listId)
|
||||
@@ -68,59 +65,4 @@ public sealed class ListConfigHubTests : IDisposable
|
||||
|
||||
Assert.Null(await GetConfigAsync(listId));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateListConfig_AllBlank_WithSerializeOnFileOverlap_KeepsFlag_RowSurvives()
|
||||
{
|
||||
var hub = CreateHub();
|
||||
var listId = await SeedListAsync();
|
||||
await SeedConfigAsync(listId, model: "opus", serializeOnFileOverlap: true);
|
||||
|
||||
await hub.UpdateListConfig(new UpdateListConfigDto(listId, null, null, null));
|
||||
|
||||
var config = await GetConfigAsync(listId);
|
||||
Assert.NotNull(config);
|
||||
Assert.True(config!.SerializeOnFileOverlap);
|
||||
Assert.Null(config.Model);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateListConfig_WithModel_UpsertsNormally_PreservesSerializeOnFileOverlap()
|
||||
{
|
||||
var hub = CreateHub();
|
||||
var listId = await SeedListAsync();
|
||||
await SeedConfigAsync(listId, serializeOnFileOverlap: true);
|
||||
|
||||
await hub.UpdateListConfig(new UpdateListConfigDto(listId, "opus", null, null));
|
||||
|
||||
var config = await GetConfigAsync(listId);
|
||||
Assert.NotNull(config);
|
||||
Assert.Equal("opus", config!.Model);
|
||||
Assert.True(config.SerializeOnFileOverlap);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateListConfig_ExplicitFalse_ClearsFlagAndDeletesOtherwiseEmptyRow()
|
||||
{
|
||||
var hub = CreateHub();
|
||||
var listId = await SeedListAsync();
|
||||
await SeedConfigAsync(listId, serializeOnFileOverlap: true);
|
||||
|
||||
await hub.UpdateListConfig(new UpdateListConfigDto(listId, null, null, null, SerializeOnFileOverlap: false));
|
||||
|
||||
Assert.Null(await GetConfigAsync(listId));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task UpdateListConfig_ExplicitTrue_SetsFlagOnOtherwiseEmptyRow()
|
||||
{
|
||||
var hub = CreateHub();
|
||||
var listId = await SeedListAsync();
|
||||
|
||||
await hub.UpdateListConfig(new UpdateListConfigDto(listId, null, null, null, SerializeOnFileOverlap: true));
|
||||
|
||||
var config = await GetConfigAsync(listId);
|
||||
Assert.NotNull(config);
|
||||
Assert.True(config!.SerializeOnFileOverlap);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user