File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
MaterialDesignThemes.UITests/WPF/TextBox Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 4
4
using System . Windows ;
5
5
using System . Windows . Controls ;
6
6
using System . Windows . Media ;
7
+ using MaterialDesignThemes . Wpf ;
7
8
using XamlTest ;
8
9
using Xunit ;
9
10
using Xunit . Abstractions ;
@@ -172,5 +173,30 @@ public async Task OnTextBoxHelperTextFontSize_ChangesHelperTextFontSize()
172
173
Assert . Equal ( 20 , fontSize ) ;
173
174
recorder . Success ( ) ;
174
175
}
176
+
177
+ [ Fact ]
178
+ [ Description ( "Issue 2203" ) ]
179
+ public async Task OnOutlinedTextBox_FloatingHintOffsetWithinRange ( )
180
+ {
181
+ await using var recorder = new TestRecorder ( App ) ;
182
+
183
+ IVisualElement grid = await LoadXaml ( @"
184
+ <Grid Margin=""30"">
185
+ <TextBox
186
+ Style=""{StaticResource MaterialDesignOutlinedTextBox}""
187
+ VerticalAlignment=""Top""
188
+ materialDesign:HintAssist.Hint=""This is a hint""
189
+ />
190
+ </Grid>" ) ;
191
+ IVisualElement textBox = await grid . GetElement ( "/TextBox" ) ;
192
+ IVisualElement hint = await textBox . GetElement ( "Hint" ) ;
193
+
194
+ Point floatingOffset = await hint . GetProperty < Point > ( SmartHint . FloatingOffsetProperty ) ;
195
+
196
+ Assert . Equal ( 0 , floatingOffset . X ) ;
197
+ Assert . InRange ( floatingOffset . Y , - 22 , - 20 ) ;
198
+
199
+ recorder . Success ( ) ;
200
+ }
175
201
}
176
202
}
You can’t perform that action at this time.
0 commit comments