@@ -82,9 +82,9 @@ describe('Resize Column', () => {
82
82
/>
83
83
) ;
84
84
85
- const thNotes = screen . getByRole ( 'columnheader' , {
85
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
86
86
name : / N o t e s / i
87
- } ) ;
87
+ } ) [ 0 ] ;
88
88
const table = thNotes . closest ( 'table' ) ;
89
89
90
90
//screen.debug(thNotes);
@@ -124,9 +124,9 @@ describe('Resize Column', () => {
124
124
/>
125
125
) ;
126
126
127
- const thNotes = screen . getByRole ( 'columnheader' , {
127
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
128
128
name : / N o t e s / i
129
- } ) ;
129
+ } ) [ 0 ] ;
130
130
const table = thNotes . closest ( 'table' ) ;
131
131
132
132
expect ( table ) . toHaveStyle ( { width : '240px' } ) ;
@@ -180,9 +180,9 @@ describe('Resize Column', () => {
180
180
/>
181
181
) ;
182
182
183
- const thNotes = screen . getByRole ( 'columnheader' , {
183
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
184
184
name : / N o t e s / i
185
- } ) ;
185
+ } ) [ 0 ] ;
186
186
const table = thNotes . closest ( 'table' ) ;
187
187
188
188
expect ( table ) . toHaveStyle ( { width : '100%' } ) ;
@@ -217,9 +217,9 @@ describe('Resize Column', () => {
217
217
/>
218
218
) ;
219
219
220
- const thNotes = screen . getByRole ( 'columnheader' , {
220
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
221
221
name : / N o t e s / i
222
- } ) ;
222
+ } ) [ 0 ] ;
223
223
224
224
expect ( thNotes . style . width ) . toBe ( `${ widthNotes } px` ) ;
225
225
@@ -244,7 +244,9 @@ describe('Resize Column', () => {
244
244
// maxWidth is less than width, can't increase width
245
245
// when reducing won't jump to maxWidth
246
246
247
- const thNotes = screen . getByRole ( 'columnheader' , { name : / N o t e s / i } ) ;
247
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
248
+ name : / N o t e s / i
249
+ } ) [ 0 ] ;
248
250
249
251
expect ( thNotes ) . toHaveStyle ( { width : '300px' } ) ;
250
252
@@ -289,8 +291,12 @@ describe('Resize Column', () => {
289
291
/>
290
292
) ;
291
293
292
- const thNotes = screen . getByRole ( 'columnheader' , { name : / N o t e s / i } ) ;
293
- const thSurname = screen . getByRole ( 'columnheader' , { name : / S u r n a m e / i } ) ;
294
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
295
+ name : / N o t e s / i
296
+ } ) [ 0 ] ;
297
+ const thSurname = screen . getAllByRole ( 'columnheader' , {
298
+ name : / S u r n a m e / i
299
+ } ) [ 0 ] ;
294
300
const table = thNotes . closest ( 'table' ) ;
295
301
296
302
expect ( table ) . toHaveStyle ( { width : '100%' } ) ;
@@ -325,8 +331,12 @@ describe('Resize Column', () => {
325
331
/>
326
332
) ;
327
333
328
- const thNotes = screen . getByRole ( 'columnheader' , { name : / N o t e s / i } ) ;
329
- const thSurname = screen . getByRole ( 'columnheader' , { name : / S u r n a m e / i } ) ;
334
+ const thNotes = screen . getAllByRole ( 'columnheader' , {
335
+ name : / N o t e s / i
336
+ } ) [ 0 ] ;
337
+ const thSurname = screen . getAllByRole ( 'columnheader' , {
338
+ name : / S u r n a m e / i
339
+ } ) [ 0 ] ;
330
340
const table = thNotes . closest ( 'table' ) ;
331
341
332
342
expect ( table ) . toHaveStyle ( { width : '100%' } ) ;
@@ -355,8 +365,12 @@ describe('Resize Column', () => {
355
365
/>
356
366
) ;
357
367
358
- const thName = screen . getByRole ( 'columnheader' , { name : / ^ N a m e $ / i } ) ;
359
- const thSurname = screen . getByRole ( 'columnheader' , { name : / S u r n a m e / i } ) ;
368
+ const thName = screen . getAllByRole ( 'columnheader' , {
369
+ name : / ^ N a m e $ / i
370
+ } ) [ 0 ] ;
371
+ const thSurname = screen . getAllByRole ( 'columnheader' , {
372
+ name : / S u r n a m e / i
373
+ } ) [ 0 ] ;
360
374
361
375
resize ( thName , [ - 10 ] ) ;
362
376
// Only move 5 because of maxWidth on surname
0 commit comments