Benjamin Lee
Benjamin Lee

Reputation: 1224

CSSTransition component's callbacks are not called in Cypress testing environment

I've been using this React CSSTransition component:

http://reactcommunity.org/react-transition-group/css-transition

I'm adding Cypress tests. CSSTransition callbacks such as onExited and onEntered always run when I'm walking through my app in a regular browser (Chrome). But in the version of Chrome being automated by Cypress, these callbacks are either never called or never executed.

I wonder if anyone else has run into this issue, or has some ideas about why it's happening, and how to fix it, or work around it.

Upvotes: 0

Views: 219

Answers (1)

Benjamin Lee
Benjamin Lee

Reputation: 1224

It had to do with cy.clock. If you use cy.clock earlier in the test, you need to use cy.tick, or

        cy.clock().then((clock) => {
            clock.restore()
        })

Upvotes: 1

Related Questions