Files
LlamaCasty/ytLive.Tests/RenameRecordingDialogSizingTests.cs
T
gramps f91bf8715d fix(reorder): save layer list AND preview layout immediately at drop; recording save dialog +10% (276→304)
Reorder: OnSceneElementsReordered now calls SaveLayoutNow() (was debounced
ScheduleSave) so a drag-drop persists instantly — one write stores the new
layer list (Source.SortOrder) and each layer's preview geometry (X/Y/W/H) in
the same rows. Reference: WPF ListBox drag-reorder requires an explicit persist
at drop; a debounce window lets a crash lose the drop.

Recording save dialog (RenameRecordingDialog.xaml): height 276→304 so the
Cancel/Save button row is no longer obscured; Save button named
SaveRecordingButton so the sizing test can assert it sits inside the client area.

Tests: deterministic seam test now asserts the dragged layer's geometry (preview
layout) is persisted with the new order; sizing test asserts 304 + textbox and
button-row bottoms within client area. 308/308 green.
2026-09-18 10:20:25 -07:00

58 lines
2.1 KiB
C#

using System.Windows;
using Xunit;
namespace ytLive.Tests;
/// <summary>
/// The Rename Recording modal (the creator-reported dialog shown when a recording
/// is ended, so it can be saved under a readable name) cut off its file-name textbox
/// — and once the height was bumped 20% the Cancel/Save button row was revealed as
/// previously obscured too. Height raised 230 → 304 (+20% then another +10%); this
/// test renders the real dialog and asserts the textbox bottom edge AND the button
/// row sit inside the client area instead of clipping.
/// </summary>
[Collection("RealApp")]
public sealed class RenameRecordingDialogSizingTests
{
private readonly RealAppHost _app;
public RenameRecordingDialogSizingTests(RealAppHost app) => _app = app;
[Fact]
public void DialogHeight_CoversTextboxAndButtonRow_WithoutClipping()
{
_app.Run(Run);
}
private void Run()
{
var dialog = new RenameRecordingDialog("rec-2026-09-18");
try
{
Assert.Equal(304, 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 boxBottom = box.TransformToAncestor(client)
.TransformBounds(new Rect(box.RenderSize)).Bottom;
Assert.True(boxBottom <= client.ActualHeight,
$"textbox bottom ({boxBottom:0.##}) must sit inside the client area " +
$"({client.ActualHeight:0.##}) — the dialog is clipping the name box");
var save = (FrameworkElement)client.FindName("SaveRecordingButton")!;
var saveBottom = save.TransformToAncestor(client)
.TransformBounds(new Rect(save.RenderSize)).Bottom;
Assert.True(saveBottom <= client.ActualHeight,
$"Save button bottom ({saveBottom:0.##}) must sit inside the client area " +
$"({client.ActualHeight:0.##}) — the button row is obscured");
}
finally
{
dialog.Close();
}
}
}