fix(rd21): guard career and job saves with durable revisions
This commit is contained in:
@@ -39,7 +39,7 @@ public sealed class CvAiReadinessTests
|
||||
Db = new(new DbContextOptionsBuilder<JobTrackerContext>().UseSqlite(Connection).Options, current.Object);
|
||||
await Db.Database.EnsureCreatedAsync();
|
||||
Career = new(Db);
|
||||
await Career.SaveVersionAsync("owner", Profile, "manual", default);
|
||||
await Career.SaveVersionAsync("owner", Profile, "manual", 0, default);
|
||||
Variants = new(Db, Career, new ThemedCvRenderer());
|
||||
Cv = await Variants.CreateAsync("owner", "Synthetic CV", null, new CvVariantSettings(), default);
|
||||
Suggestions = new(Db, Career, Variants, Ai.Object, Protection);
|
||||
@@ -150,7 +150,7 @@ public sealed class CvAiReadinessTests
|
||||
if (canonical)
|
||||
{
|
||||
fixture.Profile.Summary = ["Newer canonical user content"];
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", default);
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", 1, default);
|
||||
}
|
||||
else await fixture.Variants.SaveAsync("owner", fixture.Cv.Id, null,
|
||||
new CvVariantSettings { Headline = "Newer CV user content" }, "manual", 1, default);
|
||||
@@ -191,7 +191,7 @@ public sealed class CvAiReadinessTests
|
||||
.Returns(async () =>
|
||||
{
|
||||
fixture.Profile.Summary = ["Newer canonical content"];
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", default);
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", 1, default);
|
||||
return new AiGenerationResult(Assessment(shortened, Source));
|
||||
});
|
||||
var error = await Assert.ThrowsAsync<CvAiSuggestionException>(() => fixture.Suggestions.ApplyAsync("owner", fixture.Cv.Id, proposal.ProposalToken, shortened, default));
|
||||
@@ -359,7 +359,7 @@ public sealed class CvAiReadinessTests
|
||||
{
|
||||
await using var fixture = new Fixture(); await fixture.Open();
|
||||
fixture.Profile.Jobs = [new() { Id = "experience-key", Title = "Engineer", Company = "Nordlys", Bullets = { Source } }];
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", default);
|
||||
await fixture.Career.SaveVersionAsync("owner", fixture.Profile, "manual", 1, default);
|
||||
await fixture.Variants.SaveAsync("owner", fixture.Cv.Id, null, new CvVariantSettings
|
||||
{ AccentColor = "#123456", PageMarginMm = 22, Sections = { new() { Key = "experience" }, new() { Key = "summary" } } }, "manual", 1, default);
|
||||
fixture.Ai.Setup(value => value.GenerateSectionWithMetadataAsync(It.IsAny<string>(), It.IsAny<string>(), AiGenerationOutputMode.CvBlocksJson, It.IsAny<int>(), It.IsAny<int>(), It.IsAny<CancellationToken>()))
|
||||
|
||||
Reference in New Issue
Block a user