@@ -56,27 +56,26 @@ public void BitNumberFieldShouldHaveCorrectLabel(string label)
56
56
}
57
57
58
58
[ DataTestMethod ,
59
- DataRow ( true ) ,
60
- DataRow ( false )
59
+ DataRow ( null ) ,
60
+ DataRow ( BitSpinButtonMode . Compact ) ,
61
+ DataRow ( BitSpinButtonMode . Inline ) ,
62
+ DataRow ( BitSpinButtonMode . Spread )
61
63
]
62
- public void BitNumberFieldShouldRenderCorrectlyWithArrows ( bool arrows )
64
+ public void BitNumberFieldShouldRenderCorrectlyWithArrows ( BitSpinButtonMode ? mode )
63
65
{
64
66
var component = RenderComponent < BitNumberField < int > > ( parameters =>
65
67
{
66
- parameters . Add ( p => p . ShowButtons , arrows ) ;
68
+ parameters . Add ( p => p . Mode , mode ) ;
67
69
} ) ;
68
70
69
- var arrowButtonHolder = component . FindAll ( ".bit-nfl-act" ) ;
70
- var arrowButtons = component . FindAll ( ".bit-nfl-act button" ) ;
71
+ var arrowButtons = component . FindAll ( "button" ) ;
71
72
72
- if ( arrows )
73
+ if ( mode . HasValue )
73
74
{
74
- Assert . AreEqual ( 1 , arrowButtonHolder . Count ) ;
75
75
Assert . AreEqual ( 2 , arrowButtons . Count ) ;
76
76
}
77
77
else
78
78
{
79
- Assert . AreEqual ( 0 , arrowButtonHolder . Count ) ;
80
79
Assert . AreEqual ( 0 , arrowButtons . Count ) ;
81
80
}
82
81
}
@@ -92,7 +91,7 @@ public void BitNumberFieldShouldRenderCorrectIconWithEnableArrows(string iconNam
92
91
{
93
92
parameters . Add ( p => p . IconName , iconName ) ;
94
93
parameters . Add ( p => p . IconAriaLabel , iconAriaLabel ) ;
95
- parameters . Add ( p => p . ShowButtons , true ) ;
94
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
96
95
} ) ;
97
96
98
97
if ( iconName . HasValue ( ) )
@@ -153,7 +152,7 @@ public void BitNumberFieldShouldRenderCorrectIncrementButton(string iconName, st
153
152
parameters . Add ( p => p . IncrementIconName , iconName ) ;
154
153
parameters . Add ( p => p . IncrementAriaLabel , iconAriaLabel ) ;
155
154
parameters . Add ( p => p . IsEnabled , isEnabled ) ;
156
- parameters . Add ( p => p . ShowButtons , true ) ;
155
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
157
156
} ) ;
158
157
159
158
var button = component . Find ( "button" ) ;
@@ -182,7 +181,7 @@ public void BitNumberFieldShouldRenderCorrectDecrementButton(string iconName, st
182
181
parameters . Add ( p => p . DecrementIconName , iconName ) ;
183
182
parameters . Add ( p => p . DecrementAriaLabel , iconAriaLabel ) ;
184
183
parameters . Add ( p => p . IsEnabled , isEnabled ) ;
185
- parameters . Add ( p => p . ShowButtons , true ) ;
184
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
186
185
} ) ;
187
186
188
187
var button = component . Find ( "button:last-child" ) ;
@@ -219,21 +218,30 @@ public void BitNumberFieldShouldHaveNumberFormaWhenItsPropertySet(string numberF
219
218
}
220
219
221
220
[ DataTestMethod ,
222
- DataRow ( true ) ,
223
- DataRow ( false )
221
+ DataRow ( null ) ,
222
+ DataRow ( BitLabelPosition . Start ) ,
223
+ DataRow ( BitLabelPosition . End ) ,
224
+ DataRow ( BitLabelPosition . Top ) ,
225
+ DataRow ( BitLabelPosition . Bottom )
224
226
]
225
- public void BitNumberFieldShouldHaveLabelPositionClassName ( bool inlineLabel )
227
+ public void BitNumberFieldShouldHaveLabelPositionClassName ( BitLabelPosition ? labelPosition )
226
228
{
227
229
var component = RenderComponent < BitNumberField < int > > ( parameters =>
228
230
{
229
- parameters . Add ( p => p . InlineLabel , inlineLabel ) ;
231
+ parameters . Add ( p => p . LabelPosition , labelPosition ) ;
230
232
} ) ;
231
233
232
- var lblClass = inlineLabel ? "ilb" : "tlb" ;
234
+ var lblClass = labelPosition switch
235
+ {
236
+ BitLabelPosition . Bottom => "bit-nfl-lbt" ,
237
+ BitLabelPosition . Start => "bit-nfl-lst" ,
238
+ BitLabelPosition . End => "bit-nfl-led" ,
239
+ _ => "bit-nfl-ltp"
240
+ } ;
233
241
234
242
var numberFieldButton = component . Find ( ".bit-nfl" ) ;
235
243
236
- Assert . IsTrue ( numberFieldButton . ClassList . Contains ( $ "bit-nfl- { lblClass } " ) ) ;
244
+ Assert . IsTrue ( numberFieldButton . ClassList . Contains ( lblClass ) ) ;
237
245
}
238
246
239
247
[ DataTestMethod ,
@@ -268,7 +276,7 @@ public void BitNumberFieldWrapperShouldHaveCorrectAttributes(string title, strin
268
276
parameters . Add ( p => p . AriaPositionInSet , ariaPositionInSet ) ;
269
277
} ) ;
270
278
271
- var ntfWrapper = component . Find ( ".bit-nfl-wrp " ) ;
279
+ var ntfWrapper = component . Find ( ".bit-nfl-cnt " ) ;
272
280
273
281
if ( string . IsNullOrEmpty ( title ) is false )
274
282
{
@@ -334,7 +342,7 @@ public async Task BitNumberFieldOnIncrementTest(int countOfClicks)
334
342
var onIncrementEventCounter = 0 ;
335
343
var component = RenderComponent < BitNumberField < int > > ( parameters =>
336
344
{
337
- parameters . Add ( p => p . ShowButtons , true ) ;
345
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
338
346
parameters . Add ( p => p . OnIncrement , ( ) => onIncrementEventCounter ++ ) ;
339
347
} ) ;
340
348
@@ -359,7 +367,7 @@ public async Task BitNumberFieldOnDecrementTest(int countOfClicks)
359
367
var onDecrementEventCounter = 20 ;
360
368
var component = RenderComponent < BitNumberField < int > > ( parameters =>
361
369
{
362
- parameters . Add ( p => p . ShowButtons , true ) ;
370
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
363
371
parameters . Add ( p => p . OnDecrement , ( ) => onDecrementEventCounter -- ) ;
364
372
} ) ;
365
373
@@ -519,7 +527,7 @@ public void BitNumberFieldIncrementButtonClickTest(int defaultValue, string step
519
527
parameters . Add ( p => p . Step , step ) ;
520
528
parameters . Add ( p => p . Max , max ) ;
521
529
parameters . Add ( p => p . DefaultValue , defaultValue ) ;
522
- parameters . Add ( p => p . ShowButtons , true ) ;
530
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
523
531
} ) ;
524
532
525
533
var input = component . Find ( "input" ) ;
@@ -576,7 +584,7 @@ public void BitNumberFieldDecrementButtonClickTest(int defaultValue, string step
576
584
parameters . Add ( p => p . Step , step ) ;
577
585
parameters . Add ( p => p . Min , min ) ;
578
586
parameters . Add ( p => p . DefaultValue , defaultValue ) ;
579
- parameters . Add ( p => p . ShowButtons , true ) ;
587
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
580
588
} ) ;
581
589
582
590
var input = component . Find ( "input" ) ;
@@ -748,7 +756,7 @@ public async Task BitNumberFieldTwoWayBoundWithCustomHandlerShouldWorkCorrect(in
748
756
parameters . Add ( p => p . Step , step ) ;
749
757
parameters . Add ( p => p . Value , BitNumberFieldTwoWayBoundValue ) ;
750
758
parameters . Add ( p => p . ValueChanged , HandleValueChanged ) ;
751
- parameters . Add ( p => p . ShowButtons , true ) ;
759
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
752
760
} ) ;
753
761
754
762
var incrementButton = component . Find ( "button.bit-nfl-aup" ) ;
@@ -788,7 +796,7 @@ public void BitNumberFieldContinuousIncrementOnPointerDownTest(int defaultValue,
788
796
parameters . Add ( p => p . Step , step ) ;
789
797
parameters . Add ( p => p . Max , max ) ;
790
798
parameters . Add ( p => p . DefaultValue , defaultValue ) ;
791
- parameters . Add ( p => p . ShowButtons , true ) ;
799
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
792
800
} ) ;
793
801
794
802
var input = component . Find ( "input" ) ;
@@ -814,7 +822,7 @@ public void BitNumberFieldContinuousDecrementOnPointerDownTest(int defaultValue,
814
822
parameters . Add ( p => p . Step , step ) ;
815
823
parameters . Add ( p => p . Min , min ) ;
816
824
parameters . Add ( p => p . DefaultValue , defaultValue ) ;
817
- parameters . Add ( p => p . ShowButtons , true ) ;
825
+ parameters . Add ( p => p . Mode , BitSpinButtonMode . Compact ) ;
818
826
} ) ;
819
827
820
828
var input = component . Find ( "input" ) ;
0 commit comments