acdream/tests/AcDream.App.Tests/UI/LayoutImporterMountTests.cs
Erik 85098f535d feat(ui): D.2b-B — sub-window mount (inheritor attaches base subtree)
LayoutImporter.Resolve now captures the resolved base element's children
and, for a pure-container leaf (no own children + no own media) inheriting
from a base WITH content, attaches that subtree. This pulls the nested
gmInventoryUI panels' content (paperdoll/backpack/3D-items) in through the
existing BaseElement+BaseLayoutId path. ShouldMountBaseChildren is a pure,
unit-tested predicate; it's inert for media-bearing inheritors and childless
style prototypes, so vitals/chat/toolbar are unaffected (existing importer
tests still green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 22:36:20 +02:00

22 lines
816 B
C#

using AcDream.App.UI.Layout;
namespace AcDream.App.Tests.UI;
public class LayoutImporterMountTests
{
[Fact]
public void Mounts_ChildlessMediaLessInheritor_WithContentfulBase()
=> Assert.True(LayoutImporter.ShouldMountBaseChildren(derivedChildCount: 0, derivedMediaCount: 0, baseChildCount: 5));
[Fact]
public void DoesNotMount_WhenDerivedHasOwnMedia() // close button / title
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(0, 1, 5));
[Fact]
public void DoesNotMount_WhenDerivedHasOwnChildren()
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(2, 0, 5));
[Fact]
public void DoesNotMount_WhenBaseIsChildless() // vitals/chat/toolbar style prototypes
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(0, 0, 0));
}