showing results for - "how to test timeout in component did mount"
Paul
15 Feb 2016
1it('button shoould start glowing', () => {
2        const wrapper = mount(<PlayButton media={{ currentTime: 0, duration: 1 }}/>);
3        wrapper.update()
4        jest.runAllTimers();
5        expect(wrapper.state('glow')).toBe(true);
6    });
Arianna
10 Apr 2020
1it('button shoould start glowing', () => {
2        let clock = sinon.useFakeTimers();
3        const wrapper = mount(<PlayButton media={{ currentTime: 0, duration: 1 }}/>);
4        wrapper.update()
5        clock.tick(3000)
6        expect(wrapper.state('glow')).toBe(true);
7    });