using System.Windows; using Xunit; namespace ytLive.Tests; /// /// The Rename Recording modal (creator-reported, 2026-09-18) cut off the file-name /// textbox: the fixed window was too short for its stacked content. The height is /// bumped 20% (230 → 276); this test renders the real dialog and asserts the textbox /// bottom edge lands inside the client area instead of clipping. /// [Collection("RealApp")] public sealed class RenameRecordingDialogSizingTests { private readonly RealAppHost _app; public RenameRecordingDialogSizingTests(RealAppHost app) => _app = app; [Fact] public void DialogHeight_Bumps20Percent_AndNameBoxIsNotClipped() { _app.Run(Run); } private void Run() { var dialog = new RenameRecordingDialog("rec-2026-09-18"); try { Assert.Equal(276, dialog.Height); dialog.Show(); dialog.UpdateLayout(); var box = dialog.NameBox; Assert.True(box.ActualWidth > 0, "file-name textbox must have a real layout"); var client = (FrameworkElement)dialog.Content; var bottom = box.TransformToAncestor(client) .TransformBounds(new Rect(box.RenderSize)).Bottom; Assert.True(bottom <= client.ActualHeight, $"textbox bottom ({bottom:0.##}) must sit inside the client area " + $"({client.ActualHeight:0.##}) — the dialog is clipping the name box"); } finally { dialog.Close(); } } }