We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b34d62c commit 21494c8Copy full SHA for 21494c8
1 file changed
test/UnitTest/Components/OtpInputTest.cs
@@ -74,4 +74,23 @@ public void Type_Ok()
74
item = cut.Find(".bb-opt-item");
75
Assert.Equal("<input type=\"password\" class=\"bb-opt-item\" maxlength=\"1\">", item.OuterHtml);
76
}
77
+
78
+ [Fact]
79
+ public async Task TriggerSetValue_Ok()
80
+ {
81
+ var v = "123456";
82
+ var cut = Context.RenderComponent<OtpInput>(pb =>
83
84
+ pb.Add(a => a.Type, OtpInputType.Text);
85
+ pb.Add(a => a.Value, v);
86
+ pb.Add(a => a.OnValueChanged, val =>
87
88
+ v = val;
89
+ return Task.CompletedTask;
90
+ });
91
92
93
+ await cut.InvokeAsync(() => cut.Instance.TriggerSetValue("234567"));
94
+ Assert.Equal("234567", v);
95
+ }
96
0 commit comments