feat: merge event rankings and attribute badges into the page printer
Interview notes can print each student's ranked events and a shared attribute legend from the same catalog as the ranking index, without leftover table markup or collapsed answer space. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,6 +16,17 @@ public class PrintTokenMap_Tests
|
||||
Assert.That(map["Grade"], Is.EqualTo("9"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Build_BuiltInRankTokenWinsOverImportedSameName()
|
||||
{
|
||||
var map = PrintTokenMap.Build(
|
||||
new Dictionary<string, string?> { ["Rank1"] = "imported" },
|
||||
new Dictionary<string, string?> { ["Rank1"] = "Coding" },
|
||||
null);
|
||||
|
||||
Assert.That(map["Rank1"], Is.EqualTo("Coding"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Build_IncludesAllImportedCatalogKeys()
|
||||
{
|
||||
@@ -56,4 +67,39 @@ public class PrintTokenMap_Tests
|
||||
|
||||
Assert.That(merged, Is.EqualTo("Hi A\\*ria"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Escape_FlattensNewlinesSoTableRowsStayIntact()
|
||||
{
|
||||
var escaped = PrintTokenMap.Escape("Drone Challenge (UAV)\r\n\r\n");
|
||||
|
||||
Assert.That(escaped, Is.EqualTo("Drone Challenge (UAV)"));
|
||||
Assert.That(escaped, Does.Not.Contain('\n'));
|
||||
Assert.That(escaped, Does.Not.Contain('\r'));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Escape_EscapesPipeForMarkdownTables()
|
||||
{
|
||||
Assert.That(PrintTokenMap.Escape("A | B"), Is.EqualTo("A \\| B"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Merge_DroneNameWithTrailingNewlines_StaysOnOneTableRow()
|
||||
{
|
||||
var map = PrintTokenMap.Build(
|
||||
null,
|
||||
new Dictionary<string, string?>
|
||||
{
|
||||
["Rank1"] = "Drone Challenge (UAV)\n\n",
|
||||
["Rank2"] = "Off the Grid"
|
||||
},
|
||||
null);
|
||||
|
||||
var merged = NoteTemplateMerger.Merge(
|
||||
"| {{Rank1}} | {{Rank2}} |\n| --- | --- |",
|
||||
map);
|
||||
|
||||
Assert.That(merged, Is.EqualTo("| Drone Challenge (UAV) | Off the Grid |\n| --- | --- |"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user