@@ -225,12 +225,12 @@ describe('DialogTrigger', function () {
225225 expect ( tray ) . toBeVisible ( ) ;
226226 } ) ;
227227
228- // this one fails
228+ // see notes in focus scope, fails in .only mode as well
229229 it ( 'should restore focus to the trigger when the dialog is closed' , async function ( ) {
230230 let { getByRole} = render (
231231 < Provider theme = { theme } >
232232 < DialogTrigger >
233- < ActionButton onFocus = { ( ) => console . log ( 'focused trigger' ) } > Trigger</ ActionButton >
233+ < ActionButton > Trigger</ ActionButton >
234234 < Dialog > contents</ Dialog >
235235 </ DialogTrigger >
236236 </ Provider >
@@ -264,11 +264,9 @@ describe('DialogTrigger', function () {
264264 expect ( dialog ) . not . toBeInTheDocument ( ) ;
265265 } ) ; // wait for animation
266266
267- console . log ( 'just before fail' ) ;
268267 expect ( document . activeElement ) . toBe ( button ) ;
269268 } ) ;
270269
271- // this one fails
272270 it ( 'should restore focus to the trigger when the dialog is closed from a hidden dismiss button' , async function ( ) {
273271 let { getByRole} = render (
274272 < Provider theme = { theme } >
@@ -308,7 +306,6 @@ describe('DialogTrigger', function () {
308306 expect ( document . activeElement ) . toBe ( button ) ;
309307 } ) ;
310308
311- // fails
312309 it ( 'should set aria-hidden on parent providers on mount and remove on unmount' , async function ( ) {
313310 let rootProviderRef = React . createRef ( ) ;
314311 let { getByRole} = render (
@@ -349,7 +346,6 @@ describe('DialogTrigger', function () {
349346 expect ( rootProviderRef . current . UNSAFE_getDOMNode ( ) ) . not . toHaveAttribute ( 'aria-hidden' ) ;
350347 } ) ;
351348
352- // fails
353349 it ( 'can be controlled' , async function ( ) {
354350 function Test ( { isOpen, onOpenChange} ) {
355351 return (
@@ -412,7 +408,6 @@ describe('DialogTrigger', function () {
412408 } ) ; // wait for animation
413409 } ) ;
414410
415- // fails
416411 it ( 'can be uncontrolled with defaultOpen' , async function ( ) {
417412 function Test ( { defaultOpen, onOpenChange} ) {
418413 return (
@@ -451,7 +446,6 @@ describe('DialogTrigger', function () {
451446 } ) ; // wait for animation
452447 } ) ;
453448
454- // fails
455449 it ( 'can be closed by buttons the user adds' , async function ( ) {
456450 function Test ( { defaultOpen, onOpenChange} ) {
457451 return (
@@ -491,7 +485,6 @@ describe('DialogTrigger', function () {
491485 } ) ; // wait for animation
492486 } ) ;
493487
494- // fails
495488 it ( 'can be closed by dismiss button in dialog' , async function ( ) {
496489 function Test ( { defaultOpen, onOpenChange} ) {
497490 return (
@@ -531,7 +524,6 @@ describe('DialogTrigger', function () {
531524 } ) ; // wait for animation
532525 } ) ;
533526
534- // fails
535527 it ( 'dismissable modals can be closed by clicking outside the dialog' , async function ( ) {
536528 function Test ( { defaultOpen, onOpenChange} ) {
537529 return (
@@ -570,7 +562,6 @@ describe('DialogTrigger', function () {
570562 } ) ; // wait for animation
571563 } ) ;
572564
573- // fails
574565 it ( 'non dismissable modals cannot be closed by clicking outside the dialog' , async function ( ) {
575566 function Test ( { defaultOpen, onOpenChange} ) {
576567 return (
@@ -603,7 +594,6 @@ describe('DialogTrigger', function () {
603594 expect ( onOpenChange ) . toHaveBeenCalledTimes ( 0 ) ;
604595 } ) ;
605596
606- // fails
607597 it ( 'mobile type modals should be closable by clicking outside the modal' , async function ( ) {
608598 matchMedia . useMediaQuery ( '(max-width: 700px)' ) ;
609599 function Test ( { defaultOpen, onOpenChange} ) {
@@ -643,7 +633,6 @@ describe('DialogTrigger', function () {
643633 } ) ; // wait for animation
644634 } ) ;
645635
646- // fails
647636 it ( 'non-modals can be closed by clicking outside the dialog regardless of isDismissable' , async function ( ) {
648637 function Test ( { defaultOpen, onOpenChange} ) {
649638 return (
@@ -682,7 +671,6 @@ describe('DialogTrigger', function () {
682671 } ) ; // wait for animation
683672 } ) ;
684673
685- // fails
686674 it ( 'disable closing dialog via escape key' , async function ( ) {
687675 let { getByRole} = render (
688676 < Provider theme = { theme } >
0 commit comments