diff --git a/test/UnitTest/Components/CollapseTest.cs b/test/UnitTest/Components/CollapseTest.cs index 04b8a1ae916..cb421ee0d95 100644 --- a/test/UnitTest/Components/CollapseTest.cs +++ b/test/UnitTest/Components/CollapseTest.cs @@ -88,7 +88,26 @@ public void TitleColor_Ok() builder.CloseComponent(); })); }); - cut.Contains("btn-secondary"); + cut.Contains("bg-secondary"); + } + + [Fact] + public void HeaderTemplate_Ok() + { + var cut = Context.RenderComponent(pb => + { + pb.Add(a => a.CollapseItems, new RenderFragment(builder => + { + builder.OpenComponent(0); + builder.AddAttribute(1, nameof(CollapseItem.Text), "Item 1"); + builder.AddAttribute(2, nameof(CollapseItem.ChildContent), new RenderFragment(b => b.AddContent(0, "1"))); + builder.AddAttribute(3, nameof(CollapseItem.HeaderTemplate), new RenderFragment(b => b.AddMarkupContent(0, "
Header-Template
"))); + builder.AddAttribute(4, nameof(CollapseItem.HeaderClass), "header-class-test"); + builder.CloseComponent(); + })); + }); + cut.Contains("header-class-test"); + cut.Contains("
Header-Template
"); } [Fact]