@@ -32,14 +32,13 @@ public void ShowAfterLabel_Ok()
32
32
var cut = Context . RenderComponent < Checkbox < string > > ( builder =>
33
33
{
34
34
builder . Add ( a => a . ShowAfterLabel , true ) ;
35
- builder . Add ( a => a . DisplayText , "Test" ) ;
36
35
} ) ;
37
- var label = cut . Find ( "label" ) ;
38
- label . MarkupMatches ( "<label class=\" form-check-label\" diff:ignore>Test</label>" ) ;
36
+ cut . MarkupMatches ( "<div class=\" form-check\" ><input class=\" form-check-input\" type=\" checkbox\" diff:ignore /></div>" ) ;
39
37
40
38
cut . SetParametersAndRender ( pb =>
41
39
{
42
40
pb . Add ( a => a . ShowLabelTooltip , true ) ;
41
+ pb . Add ( a => a . DisplayText , "Test" ) ;
43
42
} ) ;
44
43
45
44
var span = cut . Find ( "span" ) ;
@@ -116,9 +115,17 @@ public void EditorForm_Ok()
116
115
pb . Add ( a => a . Value , foo . Hobby ) ;
117
116
pb . Add ( a => a . ValueExpression , foo . GenerateValueExpression ( nameof ( foo . Hobby ) , typeof ( IEnumerable < string > ) ) ) ;
118
117
} ) ;
118
+ builder . AddChildContent < Checkbox < bool > > ( pb =>
119
+ {
120
+ pb . Add ( a => a . ShowLabel , false ) ;
121
+ pb . Add ( a => a . ShowAfterLabel , true ) ;
122
+ pb . Add ( a => a . Value , foo . Complete ) ;
123
+ pb . Add ( a => a . ValueExpression , foo . GenerateValueExpression ( nameof ( foo . Complete ) , typeof ( bool ) ) ) ;
124
+ } ) ;
119
125
} ) ;
120
126
// 断言生成 CheckboxList
121
127
Assert . Contains ( "form-check is-label" , cut . Markup ) ;
128
+ cut . Contains ( "是/否" ) ;
122
129
123
130
// 提交表单触发客户端验证
124
131
var form = cut . Find ( "form" ) ;
0 commit comments