@@ -32,14 +32,13 @@ public void ShowAfterLabel_Ok()
3232 var cut = Context . RenderComponent < Checkbox < string > > ( builder =>
3333 {
3434 builder . Add ( a => a . ShowAfterLabel , true ) ;
35- builder . Add ( a => a . DisplayText , "Test" ) ;
3635 } ) ;
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>" ) ;
3937
4038 cut . SetParametersAndRender ( pb =>
4139 {
4240 pb . Add ( a => a . ShowLabelTooltip , true ) ;
41+ pb . Add ( a => a . DisplayText , "Test" ) ;
4342 } ) ;
4443
4544 var span = cut . Find ( "span" ) ;
@@ -116,9 +115,17 @@ public void EditorForm_Ok()
116115 pb . Add ( a => a . Value , foo . Hobby ) ;
117116 pb . Add ( a => a . ValueExpression , foo . GenerateValueExpression ( nameof ( foo . Hobby ) , typeof ( IEnumerable < string > ) ) ) ;
118117 } ) ;
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+ } ) ;
119125 } ) ;
120126 // 断言生成 CheckboxList
121127 Assert . Contains ( "form-check is-label" , cut . Markup ) ;
128+ cut . Contains ( "是/否" ) ;
122129
123130 // 提交表单触发客户端验证
124131 var form = cut . Find ( "form" ) ;
0 commit comments