Skip to content

Commit

Permalink
Make sure react-tap-event-plugin initialized before react-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Feb 18, 2016
1 parent a736947 commit a5882e0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/DayPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import sinon from "sinon";
import sinonChai from "sinon-chai";

chai.use(sinonChai);
require("react-tap-event-plugin")();

testDom("<html><body></body></html>");
const React = require("react");
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand All @@ -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(
<DayPicker
numberOfMonths={1}
Expand Down Expand Up @@ -829,7 +830,7 @@ describe("DayPicker", () => {

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();

Expand Down

0 comments on commit a5882e0

Please sign in to comment.