feat(cv): harden multi-page builder
CI and Deploy / test (pull_request) Failing after 3m0s
CI and Deploy / deploy (pull_request) Has been skipped

Wrap pathological content, paginate oversized entries, measure A4 and Letter previews correctly, unify section ordering, and gate stored-output actions on saved state.
This commit is contained in:
cesnimda
2026-08-15 14:09:51 +02:00
parent d424633f95
commit 5203ddea72
19 changed files with 508 additions and 206 deletions
+46
View File
@@ -96,6 +96,27 @@ public sealed class CvBuilderTests
Assert.Contains(model.Sections, s => s.Title == "Volunteering" && s.Bullets.Contains("Coached juniors"));
}
[Fact]
public void Resolver_places_custom_sections_in_the_shared_section_order()
{
var settings = new CvVariantSettings
{
Sections =
{
new CvSectionSetting { Key = "custom:vol" },
new CvSectionSetting { Key = "summary" },
},
CustomSections =
{
new CvCustomSectionSetting { Key = "vol", Title = "Volunteering", Items = { "Coached juniors" } },
},
};
var model = CvVariantResolver.Build(Rich(), settings, "F", null);
Assert.True(model.Sections.FindIndex(section => section.Key == "custom:vol")
< model.Sections.FindIndex(section => section.Key == "summary"));
}
// ---- Renderer (one path, every theme is data) ----
[Fact]
@@ -164,6 +185,31 @@ public sealed class CvBuilderTests
Assert.False(CvThemeCatalog.Resolve("technical").AtsFriendly); // sidebar = not ATS-safe
}
[Fact]
public void Long_content_wraps_and_can_flow_across_pages_without_shrinking_typography()
{
var profile = Rich();
profile.Contact.FullName = new string('N', 180);
profile.Contact.Email = $"{new string('e', 180)}@example.com";
profile.Jobs[0].Title = new string('T', 220);
profile.Jobs[0].Company = new string('C', 220);
profile.Jobs[0].Bullets = Enumerable.Range(1, 7)
.Select(index => index == 1 ? new string('x', 500) : $"Detailed achievement {index} with readable typography.")
.ToList();
var renderer = new ThemedCvRenderer();
var model = CvVariantResolver.Build(profile, new CvVariantSettings(), "F", null);
var html = renderer.Render(model, CvThemeCatalog.Resolve("technical"), new CvVariantSettings { ThemeId = "technical" }).Html;
Assert.Contains("class=\"entry entry-flow\"", html);
Assert.Contains("class=\"item-flow\"", html);
Assert.Contains("overflow-wrap:anywhere", html);
Assert.Contains("grid-template-columns:62mm minmax(0,1fr)", html);
Assert.Contains("overflow:visible", html);
Assert.Contains("white-space:normal", html);
Assert.DoesNotContain("transform:scale", html);
}
[Fact]
public void Accent_override_reaches_the_css()
{