Skip to content

Commit 41a7328

Browse files
committed
test: 补充单元测试
1 parent 39e82dc commit 41a7328

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/UnitTest/Components/TooltipTest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,17 @@ public void FallbackPlacements_Ok()
176176
});
177177
cut.Contains("data-bs-fallbackPlacements=\"top,left\"");
178178
}
179+
180+
[Fact]
181+
public async Task Toggle_Ok()
182+
{
183+
var cut = Context.RenderComponent<Tooltip>(pb =>
184+
{
185+
pb.Add(a => a.Title, "test_tooltip");
186+
pb.Add(a => a.Trigger, "manual");
187+
});
188+
await cut.InvokeAsync(() => cut.Instance.Show());
189+
await cut.InvokeAsync(() => cut.Instance.Hide());
190+
await cut.InvokeAsync(() => cut.Instance.Toggle());
191+
}
179192
}

0 commit comments

Comments
 (0)