feat(data): add ImportTickets prime kind, ticket fallback list and import prompt
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -60,4 +61,31 @@ public sealed class TicketFieldsTests : IDisposable
|
||||
Assert.Null((await read.Tasks.SingleAsync()).TicketRef);
|
||||
Assert.Null((await read.ListConfigs.SingleAsync()).TicketProjectId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TicketFallbackListId_round_trips_and_survives_a_settings_save()
|
||||
{
|
||||
await using (var ctx = NewContext())
|
||||
await new AppSettingsRepository(ctx).SetTicketFallbackListIdAsync("l-fallback");
|
||||
|
||||
// The general settings save must not wipe it — UpdateAsync's copy block doesn't carry it.
|
||||
await using (var ctx = NewContext())
|
||||
{
|
||||
var repo = new AppSettingsRepository(ctx);
|
||||
await repo.UpdateAsync(await repo.GetAsync());
|
||||
}
|
||||
|
||||
await using var read = NewContext();
|
||||
Assert.Equal("l-fallback", (await new AppSettingsRepository(read).GetAsync()).TicketFallbackListId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Blank_TicketFallbackListId_is_stored_as_null()
|
||||
{
|
||||
await using (var ctx = NewContext())
|
||||
await new AppSettingsRepository(ctx).SetTicketFallbackListIdAsync(" ");
|
||||
|
||||
await using var read = NewContext();
|
||||
Assert.Null((await new AppSettingsRepository(read).GetAsync()).TicketFallbackListId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user