@@ -207,12 +207,12 @@ describe('<TreeItem />', () => {
207207 ) ;
208208
209209 getByTestId ( 'start' ) . focus ( ) ;
210- expect ( getByTestId ( 'start' ) ) . to . be . focused ;
210+ expect ( getByTestId ( 'start' ) ) . to . have . focus ;
211211
212212 fireEvent . keyDown ( document . activeElement , { key : 'Tab' } ) ;
213213 getByTestId ( 'one' ) . focus ( ) ;
214214
215- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
215+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
216216 } ) ;
217217
218218 it ( 'should focus the selected node if a node is selected before the tree receives focus' , ( ) => {
@@ -229,15 +229,15 @@ describe('<TreeItem />', () => {
229229 ) ;
230230
231231 fireEvent . click ( getByText ( 'two' ) ) ;
232- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
232+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
233233
234234 getByTestId ( 'start' ) . focus ( ) ;
235- expect ( getByTestId ( 'start' ) ) . to . be . focused ;
235+ expect ( getByTestId ( 'start' ) ) . to . have . focus ;
236236
237237 fireEvent . keyDown ( document . activeElement , { key : 'Tab' } ) ;
238238 getByTestId ( 'two' ) . focus ( ) ;
239239
240- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
240+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
241241 } ) ;
242242 } ) ;
243243
@@ -255,7 +255,7 @@ describe('<TreeItem />', () => {
255255 getByTestId ( 'one' ) . focus ( ) ;
256256 fireEvent . keyDown ( document . activeElement , { key : 'ArrowRight' } ) ;
257257 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
258- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
258+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
259259 } ) ;
260260
261261 it ( 'should move focus to the first child if focus is on an open node' , ( ) => {
@@ -270,7 +270,7 @@ describe('<TreeItem />', () => {
270270 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
271271 getByTestId ( 'one' ) . focus ( ) ;
272272 fireEvent . keyDown ( document . activeElement , { key : 'ArrowRight' } ) ;
273- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
273+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
274274 } ) ;
275275
276276 it ( 'should do nothing if focus is on an end node' , ( ) => {
@@ -283,9 +283,9 @@ describe('<TreeItem />', () => {
283283 ) ;
284284
285285 fireEvent . click ( getByText ( 'two' ) ) ;
286- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
286+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
287287 fireEvent . keyDown ( document . activeElement , { key : 'ArrowRight' } ) ;
288- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
288+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
289289 } ) ;
290290 } ) ;
291291
@@ -304,7 +304,7 @@ describe('<TreeItem />', () => {
304304 getByTestId ( 'one' ) . focus ( ) ;
305305 fireEvent . keyDown ( document . activeElement , { key : 'ArrowLeft' } ) ;
306306 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'false' ) ;
307- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
307+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
308308 } ) ;
309309
310310 it ( "should move focus to the node's parent node if focus is on a child node that is an end node" , ( ) => {
@@ -319,7 +319,7 @@ describe('<TreeItem />', () => {
319319 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
320320 fireEvent . click ( getByText ( 'two' ) ) ;
321321 fireEvent . keyDown ( document . activeElement , { key : 'ArrowLeft' } ) ;
322- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
322+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
323323 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
324324 } ) ;
325325
@@ -341,7 +341,7 @@ describe('<TreeItem />', () => {
341341 fireEvent . click ( getByText ( 'two' ) ) ;
342342 expect ( getByTestId ( 'two' ) ) . to . have . attribute ( 'aria-expanded' , 'false' ) ;
343343 fireEvent . keyDown ( document . activeElement , { key : 'ArrowLeft' } ) ;
344- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
344+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
345345 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
346346 } ) ;
347347
@@ -357,7 +357,7 @@ describe('<TreeItem />', () => {
357357 getByTestId ( 'one' ) . focus ( ) ;
358358 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'false' ) ;
359359 fireEvent . keyDown ( document . activeElement , { key : 'ArrowLeft' } ) ;
360- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
360+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
361361 } ) ;
362362
363363 it ( 'should do nothing if focus is on a root node that is an end node' , ( ) => {
@@ -369,7 +369,7 @@ describe('<TreeItem />', () => {
369369
370370 getByTestId ( 'one' ) . focus ( ) ;
371371 fireEvent . keyDown ( document . activeElement , { key : 'ArrowLeft' } ) ;
372- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
372+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
373373 } ) ;
374374 } ) ;
375375
@@ -384,7 +384,7 @@ describe('<TreeItem />', () => {
384384
385385 getByTestId ( 'one' ) . focus ( ) ;
386386 fireEvent . keyDown ( document . activeElement , { key : 'ArrowDown' } ) ;
387- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
387+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
388388 } ) ;
389389
390390 it ( 'moves focus to a nested node' , ( ) => {
@@ -399,7 +399,7 @@ describe('<TreeItem />', () => {
399399 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
400400 getByTestId ( 'one' ) . focus ( ) ;
401401 fireEvent . keyDown ( document . activeElement , { key : 'ArrowDown' } ) ;
402- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
402+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
403403 } ) ;
404404
405405 it ( "moves focus to a parent's sibling" , ( ) => {
@@ -414,9 +414,9 @@ describe('<TreeItem />', () => {
414414
415415 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
416416 fireEvent . click ( getByText ( 'two' ) ) ;
417- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
417+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
418418 fireEvent . keyDown ( document . activeElement , { key : 'ArrowDown' } ) ;
419- expect ( getByTestId ( 'three' ) ) . to . be . focused ;
419+ expect ( getByTestId ( 'three' ) ) . to . have . focus ;
420420 } ) ;
421421 } ) ;
422422
@@ -430,9 +430,9 @@ describe('<TreeItem />', () => {
430430 ) ;
431431
432432 fireEvent . click ( getByText ( 'two' ) ) ;
433- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
433+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
434434 fireEvent . keyDown ( document . activeElement , { key : 'ArrowUp' } ) ;
435- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
435+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
436436 } ) ;
437437
438438 it ( 'moves focus to a parent' , ( ) => {
@@ -446,9 +446,9 @@ describe('<TreeItem />', () => {
446446
447447 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
448448 fireEvent . click ( getByText ( 'two' ) ) ;
449- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
449+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
450450 fireEvent . keyDown ( document . activeElement , { key : 'ArrowUp' } ) ;
451- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
451+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
452452 } ) ;
453453
454454 it ( "moves focus to a sibling's child" , ( ) => {
@@ -463,9 +463,9 @@ describe('<TreeItem />', () => {
463463
464464 expect ( getByTestId ( 'one' ) ) . to . have . attribute ( 'aria-expanded' , 'true' ) ;
465465 fireEvent . click ( getByText ( 'three' ) ) ;
466- expect ( getByTestId ( 'three' ) ) . to . be . focused ;
466+ expect ( getByTestId ( 'three' ) ) . to . have . focus ;
467467 fireEvent . keyDown ( document . activeElement , { key : 'ArrowUp' } ) ;
468- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
468+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
469469 } ) ;
470470 } ) ;
471471
@@ -481,9 +481,9 @@ describe('<TreeItem />', () => {
481481 ) ;
482482
483483 fireEvent . click ( getByText ( 'four' ) ) ;
484- expect ( getByTestId ( 'four' ) ) . to . be . focused ;
484+ expect ( getByTestId ( 'four' ) ) . to . have . focus ;
485485 fireEvent . keyDown ( document . activeElement , { key : 'Home' } ) ;
486- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
486+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
487487 } ) ;
488488 } ) ;
489489
@@ -499,9 +499,9 @@ describe('<TreeItem />', () => {
499499 ) ;
500500
501501 getByTestId ( 'one' ) . focus ( ) ;
502- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
502+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
503503 fireEvent . keyDown ( document . activeElement , { key : 'End' } ) ;
504- expect ( getByTestId ( 'four' ) ) . to . be . focused ;
504+ expect ( getByTestId ( 'four' ) ) . to . have . focus ;
505505 } ) ;
506506
507507 it ( 'moves focus to the last node in the tree with expanded items' , ( ) => {
@@ -519,9 +519,9 @@ describe('<TreeItem />', () => {
519519 ) ;
520520
521521 getByTestId ( 'one' ) . focus ( ) ;
522- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
522+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
523523 fireEvent . keyDown ( document . activeElement , { key : 'End' } ) ;
524- expect ( getByTestId ( 'six' ) ) . to . be . focused ;
524+ expect ( getByTestId ( 'six' ) ) . to . have . focus ;
525525 } ) ;
526526 } ) ;
527527
@@ -569,15 +569,15 @@ describe('<TreeItem />', () => {
569569 ) ;
570570
571571 getByTestId ( 'one' ) . focus ( ) ;
572- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
572+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
573573 fireEvent . keyDown ( document . activeElement , { key : 't' } ) ;
574- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
574+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
575575
576576 fireEvent . keyDown ( document . activeElement , { key : 'f' } ) ;
577- expect ( getByTestId ( 'four' ) ) . to . be . focused ;
577+ expect ( getByTestId ( 'four' ) ) . to . have . focus ;
578578
579579 fireEvent . keyDown ( document . activeElement , { key : 'o' } ) ;
580- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
580+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
581581 } ) ;
582582
583583 it ( 'moves focus to the next node with the same starting character' , ( ) => {
@@ -591,15 +591,15 @@ describe('<TreeItem />', () => {
591591 ) ;
592592
593593 getByTestId ( 'one' ) . focus ( ) ;
594- expect ( getByTestId ( 'one' ) ) . to . be . focused ;
594+ expect ( getByTestId ( 'one' ) ) . to . have . focus ;
595595 fireEvent . keyDown ( document . activeElement , { key : 't' } ) ;
596- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
596+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
597597
598598 fireEvent . keyDown ( document . activeElement , { key : 't' } ) ;
599- expect ( getByTestId ( 'three' ) ) . to . be . focused ;
599+ expect ( getByTestId ( 'three' ) ) . to . have . focus ;
600600
601601 fireEvent . keyDown ( document . activeElement , { key : 't' } ) ;
602- expect ( getByTestId ( 'two' ) ) . to . be . focused ;
602+ expect ( getByTestId ( 'two' ) ) . to . have . focus ;
603603 } ) ;
604604 } ) ;
605605
0 commit comments