May 2019
Intermediate to advanced
496 pages
10h 38m
English
We'll do this by introducing a new state variable in the Drawing component, named isAnimating, and toggle it to true if we're currently animating, and false otherwise:
describe('isAnimating', () => { describe('draw line animation', () => { it('adds isAnimating class to viewport when animation begins', () => { renderWithStore(<Drawing />, { script: { drawCommands: [horizontalLine] } }); triggerRequestAnimationFrame(0); expect( container.querySelector('#viewport').className ).toContain('isAnimating'); ...Read now
Unlock full access