Mirror: React hooks for accessible, common web interactions. UI super powers without the UI.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add touch event to useDismissable tests

+18 -4
+18 -4
src/__tests__/useDismissable.test.tsx
··· 25 25 </main> 26 26 ); 27 27 28 - cy.get('.inside').as('inside').click(); 28 + cy.get('.inside').as('inside').realClick(); 29 29 cy.get('@inside').should('be.visible'); 30 - cy.get('.outside').first().click(); 30 + cy.get('.outside').first().realClick(); 31 31 cy.get('@inside').should('not.be.visible'); 32 32 }); 33 33 ··· 42 42 43 43 cy.get('.inside').as('inside').should('be.visible'); 44 44 // at first not dismissed 45 - cy.get('.outside').first().click(); 45 + cy.get('.outside').first().realClick(); 46 46 cy.get('@inside').should('be.visible'); 47 47 // dismissed when the second Dialog loses focus 48 - cy.get('.outside').first().click(); 48 + cy.get('.outside').first().realClick(); 49 + cy.get('@inside').should('not.be.visible'); 50 + }); 51 + 52 + it('is dismissed by tapping outside', () => { 53 + mount( 54 + <main> 55 + <button className="outside">outside</button> 56 + <Dialog /> 57 + </main> 58 + ); 59 + 60 + cy.get('.inside').as('inside').realClick(); 61 + cy.get('@inside').should('be.visible'); 62 + cy.get('.outside').first().realTouch(); 49 63 cy.get('@inside').should('not.be.visible'); 50 64 }); 51 65