From d9ffee47e6caeb0d31305b87b1d4e16528f8708b Mon Sep 17 00:00:00 2001 From: Josh Black Date: Thu, 5 Sep 2019 11:24:01 -0500 Subject: [PATCH] test(react): update tests with setTimeout updates --- packages/react/src/components/Copy/Copy-test.js | 4 ++-- packages/react/src/components/CopyButton/CopyButton-test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/components/Copy/Copy-test.js b/packages/react/src/components/Copy/Copy-test.js index f3f0718c6b12..350fe703f625 100644 --- a/packages/react/src/components/Copy/Copy-test.js +++ b/packages/react/src/components/Copy/Copy-test.js @@ -80,8 +80,8 @@ describe('Copy', () => { expect(feedbackWrapper.state().showFeedback).toBe(false); feedbackWrapper.simulate('click'); expect(feedbackWrapper.state().showFeedback).toBe(true); - expect(setTimeout.mock.calls.length).toBe(1); - expect(setTimeout.mock.calls[0][1]).toBe(5000); + expect(setTimeout.mock.calls.length).toBe(2); + expect(setTimeout.mock.calls[1][1]).toBe(5000); jest.runAllTimers(); expect(feedbackWrapper.state().showFeedback).toBe(false); }); diff --git a/packages/react/src/components/CopyButton/CopyButton-test.js b/packages/react/src/components/CopyButton/CopyButton-test.js index 7a6879ec6532..7eae23a58f1d 100644 --- a/packages/react/src/components/CopyButton/CopyButton-test.js +++ b/packages/react/src/components/CopyButton/CopyButton-test.js @@ -87,8 +87,8 @@ describe('CopyButton', () => { expect(feedbackWrapper.state().showFeedback).toBe(false); feedbackWrapper.simulate('click'); expect(feedbackWrapper.state().showFeedback).toBe(true); - expect(setTimeout.mock.calls.length).toBe(1); - expect(setTimeout.mock.calls[0][1]).toBe(5000); + expect(setTimeout.mock.calls.length).toBe(2); + expect(setTimeout.mock.calls[1][1]).toBe(5000); jest.runAllTimers(); expect(feedbackWrapper.state().showFeedback).toBe(false); });