From a5882e077938f04c2c0849d8631f9bd93cda729a Mon Sep 17 00:00:00 2001 From: Giampaolo Bellavite Date: Thu, 18 Feb 2016 01:16:50 +0100 Subject: [PATCH] Make sure react-tap-event-plugin initialized before react-dom --- test/DayPicker.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/DayPicker.js b/test/DayPicker.js index c92ea78511..36c22fd2ed 100644 --- a/test/DayPicker.js +++ b/test/DayPicker.js @@ -5,6 +5,7 @@ import sinon from "sinon"; import sinonChai from "sinon-chai"; chai.use(sinonChai); +require("react-tap-event-plugin")(); testDom(""); const React = require("react"); @@ -615,7 +616,7 @@ describe("DayPicker", () => { it("calls event handlers on a day cell", () => { - require("react-tap-event-plugin")(); + function isFirstDay(d) { return d.getFullYear() === 2015 && @@ -674,7 +675,7 @@ describe("DayPicker", () => { it("calls touch-tap event handler on a day cell", () => { - require("react-tap-event-plugin")(); + const handleTouchTap = sinon.spy(); @@ -711,7 +712,7 @@ describe("DayPicker", () => { it("does not call mouse events on disabled outside days", () => { - require("react-tap-event-plugin")(); + const handleClick = sinon.spy(); const handleMouseEnter = sinon.spy(); @@ -747,7 +748,7 @@ describe("DayPicker", () => { it("changes the month when tapping on enabled outside days", () => { - require("react-tap-event-plugin")(); + const handleTouchTap = sinon.spy(); @@ -769,7 +770,7 @@ describe("DayPicker", () => { }); it("shows the previous month when clicking on (enabled) outside days", () => { - require("react-tap-event-plugin")(); + const dayPickerEl = TestUtils.renderIntoDocument( { it("does not show the next month when clicking on an outside days of the first of 2 months", () => { - require("react-tap-event-plugin")(); + const handleClick = sinon.spy();