Skip to content

Commit a162771

Browse files
committed
test: 增加单元测试
1 parent 80e0d74 commit a162771

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace UnitTest.Components;
7+
8+
public class AffixTest : BootstrapBlazorTestBase
9+
{
10+
[Fact]
11+
public void Position_Ok()
12+
{
13+
var cut = Context.RenderComponent<Affix>(pb =>
14+
{
15+
pb.Add(a => a.Offset, 100);
16+
pb.Add(a => a.ZIndex, 10);
17+
pb.Add(a => a.Position, AffixPosition.Bottom);
18+
pb.Add(a => a.ChildContent, pb => pb.AddMarkupContent(0, "<button>Test</button>"));
19+
});
20+
Assert.Contains("bb-affix", cut.Markup);
21+
Assert.Contains("position: sticky;", cut.Markup);
22+
Assert.Contains("z-index: 10;", cut.Markup);
23+
Assert.Contains("bottom: 100px;", cut.Markup);
24+
}
25+
}

0 commit comments

Comments
 (0)