diff options
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
| -rw-r--r-- | src/LivingVillage.Desktop.Tests/PrototypeTests.fs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs index 524573f..c85287f 100644 --- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs +++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs @@ -246,6 +246,22 @@ type PrototypeTests () = Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "精力") [<TestMethod>] + member _.TitleScreenSelectionCursorAndLabelNeverOverprint () = + let layout = TitleScreen.layout 1280 720 + + // Heading must sit fully above the first menu row (no same-line overprint). + Assert.IsTrue(layout.FirstItemY - layout.HeadingY >= 32, sprintf "heading clearance %d" (layout.FirstItemY - layout.HeadingY)) + + // Every menu row: cursor rectangle and label rectangle must be disjoint. + for rowIndex in 0 .. 5 do + let cursor, label = TitleScreen.selectionRects layout rowIndex + Assert.IsTrue(TitleScreen.rectsDisjoint cursor label, sprintf "row %d cursor overlaps label" rowIndex) + Assert.AreEqual<int>(cursor.Y, label.Y) + + // Cursor column leaves real clearance: label starts beyond cursor + margin. + Assert.IsTrue(layout.TextX >= layout.CursorX + layout.CursorWidth) + + [<TestMethod>] member _.TitleScreenLayoutIsDeterministicAndLayered () = let first = TitleScreen.layout 1280 720 let second = TitleScreen.layout 1280 720 |
