File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
testassets/BasicTestApp/QuickGridTest Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 88using Microsoft . AspNetCore . Components . E2ETest . Infrastructure . ServerFixtures ;
99using Microsoft . AspNetCore . E2ETesting ;
1010using OpenQA . Selenium ;
11+ using OpenQA . Selenium . Support . Extensions ;
1112using Xunit . Abstractions ;
1213
1314namespace Microsoft . AspNetCore . Components . E2ETests . Tests ;
@@ -149,6 +150,23 @@ public void RowClassApplied()
149150 }
150151 }
151152
153+ [ Fact ]
154+ public void RowStyleApplied ( )
155+ {
156+ var grid = app . FindElement ( By . CssSelector ( "#grid > table" ) ) ;
157+ var birthDateColumn = grid . FindElement ( By . CssSelector ( "thead > tr > th:nth-child(4)" ) ) ;
158+ var ageColumn = grid . FindElement ( By . CssSelector ( "thead > tr > th:nth-child(5)" ) ) ;
159+
160+ Assert . Contains ( "col-justify-center" , birthDateColumn . GetAttribute ( "class" ) ) ;
161+ Assert . Contains ( "col-justify-right" , ageColumn . GetAttribute ( "class" ) ) ;
162+ Assert . Equal ( "center" , Browser . ExecuteJavaScript < string > ( @"
163+ const p = document.querySelector('tbody > tr:first-child > td:nth-child(4)');
164+ return p ? getComputedStyle(p).textAlign : null;" ) ) ;
165+ Assert . Equal ( "right" , Browser . ExecuteJavaScript < string > ( @"
166+ const p = document.querySelector('tbody > tr:first-child > td:nth-child(5)');
167+ return p ? getComputedStyle(p).textAlign : null;" ) ) ;
168+ }
169+
152170 [ Fact ]
153171 public void CanOpenColumnOptions ( )
154172 {
Original file line number Diff line number Diff line change 1414 </ColumnOptions >
1515 </PropertyColumn >
1616 <PropertyColumn Property =" @(p => p.LastName)" Sortable =" true" />
17- <PropertyColumn Property =" @(p => p.BirthDate)" Format =" yyyy-MM-dd" Sortable =" true" />
18- <PropertyColumn Title =" Age in years" Property =" @(p => ComputeAge(p.BirthDate))" Sortable =" true" />
17+ <PropertyColumn Property =" @(p => p.BirthDate)" Format =" yyyy-MM-dd" Sortable =" true" Align = " Align.Center " />
18+ <PropertyColumn Title =" Age in years" Property =" @(p => ComputeAge(p.BirthDate))" Sortable =" true" Align = " Align.Right " />
1919 </QuickGrid >
2020</div >
2121<Paginator State =" @pagination" />
You can’t perform that action at this time.
0 commit comments