@@ -114,11 +114,23 @@ function verifyFooter(assert) {
114
114
* @param assert
115
115
*/
116
116
function verifyMultiLineHeader ( assert ) {
117
+ let firstTableCellOfEachHeaderRow = findAll ( 'thead > tr > th:first-child' ) ;
118
+ let tableHeaderCellHeights = firstTableCellOfEachHeaderRow . map (
119
+ cell => cell . getBoundingClientRect ( ) . height
120
+ ) ;
121
+ let isAllHeaderCellsIdenticalHeights = tableHeaderCellHeights . every ( function ( cell , i , array ) {
122
+ return i === 0 || cell === array [ i - 1 ] ;
123
+ } ) ;
117
124
let firstCellRect = find ( 'thead tr:first-child th:first-child' ) . getBoundingClientRect ( ) ;
118
125
let expectedOffset = firstCellRect . top ;
119
126
120
- findAll ( 'thead > tr' ) . forEach ( row => {
121
- let firstCellRect = row . firstElementChild . getBoundingClientRect ( ) ;
127
+ assert . notOk (
128
+ isAllHeaderCellsIdenticalHeights ,
129
+ 'precond - header table rows have varying heights'
130
+ ) ;
131
+
132
+ firstTableCellOfEachHeaderRow . forEach ( cell => {
133
+ let firstCellRect = cell . getBoundingClientRect ( ) ;
122
134
expectedOffset += firstCellRect . height ;
123
135
assert . equal ( expectedOffset , firstCellRect . bottom ) ;
124
136
} ) ;
@@ -129,11 +141,23 @@ function verifyMultiLineHeader(assert) {
129
141
* @param assert
130
142
*/
131
143
function verifyMultiLineFooter ( assert ) {
144
+ let firstTableCellOfEachFooterRow = findAll ( 'tfoot > tr > td:first-child' ) ;
145
+ let tableFooterCellHeights = firstTableCellOfEachFooterRow . map (
146
+ cell => cell . getBoundingClientRect ( ) . height
147
+ ) ;
148
+ let isAllFooterCellsIdenticalHeights = tableFooterCellHeights . every ( function ( cell , i , array ) {
149
+ return i === 0 || cell === array [ i - 1 ] ;
150
+ } ) ;
132
151
let firstCellRect = find ( 'tfoot tr:first-child td:first-child' ) . getBoundingClientRect ( ) ;
133
152
let expectedOffset = firstCellRect . top ;
134
153
135
- findAll ( 'tfoot > tr' ) . forEach ( row => {
136
- let firstCellRect = row . firstElementChild . getBoundingClientRect ( ) ;
154
+ assert . notOk (
155
+ isAllFooterCellsIdenticalHeights ,
156
+ 'precond - footer table rows have varying heights'
157
+ ) ;
158
+
159
+ firstTableCellOfEachFooterRow . forEach ( cell => {
160
+ let firstCellRect = cell . getBoundingClientRect ( ) ;
137
161
expectedOffset += firstCellRect . height ;
138
162
assert . equal ( expectedOffset , firstCellRect . bottom ) ;
139
163
} ) ;
0 commit comments