feat(data): add ImportTickets prime kind, ticket fallback list and import prompt
This commit is contained in:
@@ -64,4 +64,15 @@ public sealed class PrimeScheduleRepositoryTests : IDisposable
|
||||
var found = await _repo.GetAsync(entity.Id);
|
||||
Assert.Equal("new override", found!.PromptOverride);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ImportTickets_kind_round_trips()
|
||||
{
|
||||
var entity = new PrimeScheduleEntity { Kind = PrimeActionKind.ImportTickets };
|
||||
|
||||
await _repo.UpsertAsync(entity);
|
||||
var found = await _repo.GetAsync(entity.Id);
|
||||
|
||||
Assert.Equal(PrimeActionKind.ImportTickets, found!.Kind);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,4 +432,12 @@ public class PromptFilesTests
|
||||
Assert.Contains("handoff_list_handler", d);
|
||||
Assert.Contains("do not continue into phase 3 yourself", d, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TicketImport_default_names_both_tools()
|
||||
{
|
||||
var d = PromptFiles.DefaultFor(PromptKind.TicketImport);
|
||||
Assert.Contains("mcp__claudedo__get_ticket_import_candidates", d);
|
||||
Assert.Contains("mcp__claudedo__import_ticket", d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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