onefinestay / react-daterange-picker

Other
563 stars 208 forks source link

Tests broken with react v15 #131

Closed jonniedarko closed 7 years ago

jonniedarko commented 8 years ago

Here is the output

| => npm run test

> react-daterange-picker@1.0.0 test /Users/John/workspace/onefinestay-datepicker
> gulp test-coverage

[09:39:04] Failed to load external module babel-register
[09:39:04] Requiring external module babel-core/register
[09:39:05] Using gulpfile ~/workspace/onefinestay-datepicker/gulpfile.babel.js
[09:39:05] Starting 'lint'...
[09:39:24] Finished 'lint' after 19 s
[09:39:24] Starting 'test-coverage'...

START:
11 04 2016 09:39:32.573:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
11 04 2016 09:39:32.589:INFO [launcher]: Starting browser PhantomJS
11 04 2016 09:39:33.701:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket /#NNmCPskr69gO_5KZAAAA with id 52308945
  The CalendarDate Component
    ✔ creates the right element
    sets the correct class
      ✔ by defininig the expected class name
      by setting the expected bem modifiers
        ✔ when the provided date is today
        ✔ when the provided date is not today
        ✔ when the provided date is over the weekend
        ✔ when the provided date is not over the weekend
        ✔ when the provided date is during the same month
        ✔ when the provided date is not during the same month
      by setting the expected bem states
        ✔ when the isDisabled prop is passed in
        ✔ when the isDisabled prop is not passed in
        ✔ when the isHighlightedDate prop is passed in
        ✔ when the isHighlightedDate prop is not passed in
        ✔ when the isSelectedDate prop is passed in
        ✔ when the isInSelectedRange prop is passed in
        ✔ when the isInHighlightedRange prop is passed in
        ✔ when the isSelectedDate, isInSelectedRange, isInHighlightedRange props are not passed in
    creates the right style
      ✔ when numStyles is 1
      ✔ when numStyles is 2
ERROR: 'Warning: validateDOMNesting(...): <td> cannot appear as a child of <tbody>. See tbody > CalendarDate > td.'
ERROR: 'Warning: validateDOMNesting(...): <td> cannot appear as a child of <tbody>. See tbody > CalendarDate > td.'
    handles touch events
      ✔ by calling props.onHighlightDate after an interaction
      ✔ by calling props.onSelectDate after an interaction
    handles mouse events
      ✔ by calling props.onHighlightDate after a mouse enter
      ✔ by calling props.onSelectDate after mouse down + mouse leave
      ✔ by calling props.onUnHighlightDate after a mouse leave
      ✔ by calling props.onSelectDate after mouse down + mouse up
    handles half days
      ✔ by creating calendar date period when there is more than one period
      ✔ by creating a simple div when there is only one period
    has a selection widget
      ✔ with a modifier prop of single if props.isSelectedDate is true and others false
      ✔ with a modifier prop of single if props.isSelectedRangeStart, props.isSelectedRangeEnd are true and others false
      ✔ with a modifier prop of single if props.isHighlightedRangeStart, props.isHighlightedRangeEnd are true and others false
      ✔ with a modifier prop of start if props.isSelectedRangeStart is true and others false
      ✔ with a modifier prop of start if props.isHighlightedRangeStart is true and others false
      ✔ with a modifier prop of end if props.isSelectedRangeEnd is true and others false
      ✔ with a modifier prop of end if props.isHighlightedRangeEnd is true and others false
      ✔ with a modifier prop of segment if props.isInSelectedRange is true and others false
      ✔ with a modifier prop of segment if props.isInHighlightedRange is true and others false
      ✔ with a pending prop of true if props.isInHighlightedRange is true and any setting showing the CalendarSelection widget
      ✔ which does not show otherwise
    has a highlight modifier
      ✔ which shows when props.isHighlightedDate is true
      ✔ which does not show otherwise
  The CalendarDatePeriod Component
    ✔ should render the right element
  The CalendarHighlight Component
    ✔ should render the right element
  The CalendarMonth Component
    ✔ should render the right element
    has a label acting as a header
      ✔ which is a div with the correct class
      displaying month information
        ✔ which creates a span with the correct class
        ✔ which displays the name of the month
        ✔ which does not show navigation if props.disableNavigation is true
        ✔ which shows navigation if props.disableNavigation is false
        ✖ which calls props.onMonthChange if props.disableNavigation is false and if the selected value changes
      displaying year information
        ✔ which creates a span with the correct class
        ✔ which displays the name of the year
        ✔ which does not show navigation if props.disableNavigation is true
        ✔ which shows navigation if props.disableNavigation is false
        ✖ which calls props.onYearChange if props.disableNavigation is false and if the selected value changes
      has a table
        ✔ which has the expected className
        ✔ whose head contains day information
        ✔ which has a body containing the weeks
  The CalendarSelection Component
    ✔ should render the right element
  The DateRangePicker component
    ✔ defines the expected top level elements
    contains PaginationArrow components
      ✔ 2 of them
      ✔ the left one gets disabled when we are at the start of the permitted period
      ✔ the left one does not get disabled when we are not at the start of the permitted period
      ✖ the left one when clicked moves the calendar one month in the past
      ✔ the right one gets disabled when we are at the end of the permitted period
      ✔ the right one does not get disabled when we are not at the end of the permitted period
      ✖ the right one when clicked moves the calendar one month in the future
    contains CalendarMonth components
      which number is
        ✔ by default only one
        ✔ otherwise a number equal to props.numberOfCalendars
      for each component the value
        when it is a moment
          ✔ is set to null if it is not included in the corresponding month
          ✔ otherwise it uses props.value
        when it is a moment range
          ✔ is set to null if it is not overlapping the corresponding month
          ✔ otherwise it uses props.value
      for each component the highlighted date
        ✖ is set to null if it is not a moment
        ✖ is set to null if the current month does not include the date
        ✖ is set to props.highlightedDate otherwise
      for each component the highlighted range
        ✖ is set to null if it is not a moment range
        ✖ is set to null if the current month does not include the date range
        ✖ defaults to props.highlightedRange
      each component takes in a large number of other attributes
        ✔ like props.bemBlock
        ✔ like props.bemNamespace
        ✔ like props.firstOfWeek
      each component is provided with a number of event handlers
        ✖ onMonthChange calls #changeMonth
        ✖ onYearChange calls #changeYear
        ✖ onSelectDate calls #onSelectDate
        ✖ onHighlightDate calls #onHighlightDate
        ✖ onUnHighlightDate calls #onUnHighlightDate
    defines a number of actions
      #changeMonth
        ✖ changes the state month to the provided value
      #changeYear
        ✖ changes the state month to the provided value
      #onSelectDate
        if props.selectionType is single
          ✖ if the date is disabled, it does not call #completeSelection
          ✖ if the date is not selectable, it does not call #completeSelection
          ✖ otherwise, it calls #completeSelection
        if props.selectionType is range
          if state.selectedStartDate is defined
            ✖ calls #completeRangeSelection
          if state.selectedStartDate is undefined
            ✖ does not call #completeRangeSelection
            if the date is disabled
              ✖ does not call #startRangeSelection
            if the date is not selectable
              ✖ does not call #startRangeSelection
            if the date is not disabled and is selectable
              ✖ calls #startRangeSelection
              ✖ if props.singleDateRange is falsy, it does not call #highlightRange
              ✖ if props.singleDateRange is true, it calls #highlightRange
      #onHighlightDate
        if props.selectionType is a single date
          ✖ if the date is disabled, it does not call #highlightDate
          ✖ if the date is not selectable, it does not call #highlightDate
          ✖ otherwise, it calls #highlightDate
        if props.selectionType is a range
          if state.selectedStartDate is defined
            ✖ calls #highlightRange
          if state.selectedStartDate is undefined
            ✖ if the date is disabled, it does not call #highlightDate
            ✖ if the date is not selectable, it does not call #highlightDate
            ✖ otherwise, it calls #highlightDate
      #onUnHighlightDate
        ✖ updates the highlightedDate state to null
    contains a help message
      ✔ if props.helpMessage is defined
      ✔ but not otherwise
    contains a Legend component
      ✔ if props.showLegend is defined
      ✔ but not otherwise
    #componentWillReceiveProps
      ✖ updates state.dateStates if data provided in the props
      ✖ updates state.enabledRange if data provided in the props
    #isDateSelectable
      ✖ returns true if the date is selectable
      ✖ returns false otherwise
    #nonSelectableStateRanges
      ✖ returns the expected range
    #dateRangesForDate
      ✖ returns the expected range
    #sanitizeRange
      if forwards is true
        ✖ and if the provided range intersects with the non selectable ranges it returns a smaller range
        ✖ and if the provided range starts before the enabled range it returns a smaller range
        ✖ and if the provided range finishes after the enabled range it returns a smaller range
        ✖ otherwise it returns the full range
      otherwise
        ✖ and if the provided range intersects with the non selectable ranges it returns a smaller range
        ✖ and if the provided range starts before the enabled range it returns a smaller range
        ✖ and if the provided range finishes after the enabled range it returns a smaller range
        ✖ otherwise it returns the full range
    #statesForDate
      ✖ returns the expected state for the provided date
    #statesForRange
      ✖ returns the expected value if a one-day range is provided
      ✖ returns the expected value if a multi-day range is provided
    #completeSelection
      if state.highlightedDate is defined
        ✖ updates states
        ✖ calls props.onSelect
      if state.highlightedDate is not defined
        ✖ does not update states
        ✖ does not call props.onSelect
    #completeRangeSelection
      if state.highlightedRange is defined
        and its start and end are two different days
          ✖ updates states
          ✖ calls props.onHighlight
        and its start and end are the same day and props.singleDateRange is true
          ✖ updates states
          ✖ calls props.onHighlight
        and its start and end are the same day and props.singleDateRange is false
          ✖ does not update states
          ✖ calls props.onHighlight
      if state.highlightedRange is not defined
        ✖ does not update states
        ✖ calls props.onHighlight
  The Legend component
    ✔ creates a ul dom element as its root
    ✔ creates at least one li, selected by default, using the props.selectedLabel
    ✔ creates extra lis based on the props.stateDefinitions
  The Pagination Arrow component
    ✔ creates the correct markup
  BemMixin
    ✔ defines a propTypes object
    ✔ defines a contextTypes object
    ✔ defines a childContextTypes object
    ✔ #getChildContext returns the bem namespace and block
    #getBemNamespace
      ✔ returns the props bem namespace if available
      ✔ returns the context bem namespace if available and if the props bem namespace is not available
      ✔ returns null otherwise
    #getBemBlock
      ✔ returns the props bem block if available
      ✔ returns the context bem block if available and if the props bem block is not available
      ✔ returns null otherwise
    #cx generates the expected class names
      ✔ using default values if no values are provided
      ✔ adds options when passed in
  CustomPropTypes
    #momentOrMomentRange
      ✔ returns null if no property matches the property name
      ✔ returns null if the property is a moment
      ✔ returns null if the property is a moment range
      ✔ throws an error otherwise
    #moment
      ✔ returns null if no property matches the property name
      ✔ returns null if the property is a moment
      ✔ throws an error otherwise
    #momentRange
      ✔ returns null if no property matches the property name
      ✔ returns null if the property is a moment range
      ✔ throws an error otherwise
  PureRenderMixin
    #shouldComponentUpdate
      ✔ return true if the object props and the nextProps argument are different
      ✔ return true if the object state and the nextState argument are different
      ✔ return false otherwise
  areMomentRangesEqual
    ✔ returns true if the two ranges start and finish on the same day
    ✔ returns false if the two ranges start on the same day but finish on different days
    ✔ returns false if the two ranges finish on the same day but start on different days
    ✔ returns false if the two ranges start and finish on different days
  bemCx
    ✔ returns a correct class name if an element and a namespace are provided
    ✔ returns a correct class name if an element and no namespace are provided
    ✔ returns a correct class name if no element and a namespace are provided
    ✔ returns a correct class name if no element and no namespace are provided
    ✔ returns the correct class names if states are provided
    ✔ returns the correct class names if modifiers are provided
    ✔ returns the correct class names if states and modifiers are provided
  isMomentRange
    ✔ returns false if no value is provided
    ✔ returns false if there is no start value
    ✔ returns false if there is no end value
    ✔ returns false is the start value is not a moment value
    ✔ returns false is the end value is not a moment value
    ✔ return true otherwise
  lightenDarkenColor
    ✔ returns colors using the # symbol if the input included one
    ✔ returns colors not using the # symbol if the input did not include one
    ✔ lighten the colors if provided with a positive number
    ✔ caps value if one of the rgb compoents goes over 255
    ✔ darken the colors if provided with a negative number
    ✔ caps value if one of the rgb compoents goes under 0
  shallowEqual
    ✔ returns true if provided with the same object
    ✔ returns false if a key is in objA but not objB
    ✔ returns false if a key is in objB but not objA
    ✔ returns false if a key matches to a moment object with different day values in objA and objB
    ✔ returns false if a key matches to a different moment range objects within objA and objB
    ✔ returns false if a key matches to a non moment or moment range object and the values are different in objA and objB
    ✔ returns true otherwise

Finished in 4.398 secs / 4.252 secs

SUMMARY:
✔ 133 tests completed
✖ 64 tests failed

FAILED TESTS:
  The CalendarMonth Component
    has a label acting as a header
      displaying month information
        ✖ which calls props.onMonthChange if props.disableNavigation is false and if the selected value changes
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_reactAddonsTestUtils2['default'].scryRenderedDOMComponentsWithTag(this.renderedComponent, 'select')[0].getDOMNode()')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:41692
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:41632

      displaying year information
        ✖ which calls props.onYearChange if props.disableNavigation is false and if the selected value changes
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_reactAddonsTestUtils2['default'].scryRenderedDOMComponentsWithTag(this.renderedComponent, 'select')[1].getDOMNode()')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:41738
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:41632

  The DateRangePicker component
    contains PaginationArrow components
      ✖ the left one when clicked moves the calendar one month in the past
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      ✖ the right one when clicked moves the calendar one month in the future
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    contains CalendarMonth components
      for each component the highlighted date
        ✖ is set to null if it is not a moment
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ is set to null if the current month does not include the date
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ is set to props.highlightedDate otherwise
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      for each component the highlighted range
        ✖ is set to null if it is not a moment range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ is set to null if the current month does not include the date range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ defaults to props.highlightedRange
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      each component is provided with a number of event handlers
        ✖ onMonthChange calls #changeMonth
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ onYearChange calls #changeYear
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ onSelectDate calls #onSelectDate
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ onHighlightDate calls #onHighlightDate
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ onUnHighlightDate calls #onUnHighlightDate
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    defines a number of actions
      #changeMonth
        ✖ changes the state month to the provided value
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      #changeYear
        ✖ changes the state month to the provided value
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      #onSelectDate
        if props.selectionType is single
          ✖ if the date is disabled, it does not call #completeSelection
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ if the date is not selectable, it does not call #completeSelection
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ otherwise, it calls #completeSelection
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        if props.selectionType is range
          if state.selectedStartDate is defined
            ✖ calls #completeRangeSelection
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          if state.selectedStartDate is undefined
            ✖ does not call #completeRangeSelection
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

            if the date is disabled
              ✖ does not call #startRangeSelection
                PhantomJS 1.9.8 (Mac OS X 0.0.0)
              TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                  at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

            if the date is not selectable
              ✖ does not call #startRangeSelection
                PhantomJS 1.9.8 (Mac OS X 0.0.0)
              TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                  at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

            if the date is not disabled and is selectable
              ✖ calls #startRangeSelection
                PhantomJS 1.9.8 (Mac OS X 0.0.0)
              TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                  at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

              ✖ if props.singleDateRange is falsy, it does not call #highlightRange
                PhantomJS 1.9.8 (Mac OS X 0.0.0)
              TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                  at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

              ✖ if props.singleDateRange is true, it calls #highlightRange
                PhantomJS 1.9.8 (Mac OS X 0.0.0)
              TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                  at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      #onHighlightDate
        if props.selectionType is a single date
          ✖ if the date is disabled, it does not call #highlightDate
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ if the date is not selectable, it does not call #highlightDate
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ otherwise, it calls #highlightDate
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        if props.selectionType is a range
          if state.selectedStartDate is defined
            ✖ calls #highlightRange
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          if state.selectedStartDate is undefined
            ✖ if the date is disabled, it does not call #highlightDate
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

            ✖ if the date is not selectable, it does not call #highlightDate
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

            ✖ otherwise, it calls #highlightDate
              PhantomJS 1.9.8 (Mac OS X 0.0.0)
            TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
                at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      #onUnHighlightDate
        ✖ updates the highlightedDate state to null
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #componentWillReceiveProps
      ✖ updates state.dateStates if data provided in the props
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      ✖ updates state.enabledRange if data provided in the props
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #isDateSelectable
      ✖ returns true if the date is selectable
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      ✖ returns false otherwise
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #nonSelectableStateRanges
      ✖ returns the expected range
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #dateRangesForDate
      ✖ returns the expected range
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #sanitizeRange
      if forwards is true
        ✖ and if the provided range intersects with the non selectable ranges it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ and if the provided range starts before the enabled range it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ and if the provided range finishes after the enabled range it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ otherwise it returns the full range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      otherwise
        ✖ and if the provided range intersects with the non selectable ranges it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ and if the provided range starts before the enabled range it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ and if the provided range finishes after the enabled range it returns a smaller range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ otherwise it returns the full range
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #statesForDate
      ✖ returns the expected state for the provided date
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #statesForRange
      ✖ returns the expected value if a one-day range is provided
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      ✖ returns the expected value if a multi-day range is provided
        PhantomJS 1.9.8 (Mac OS X 0.0.0)
      TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
          at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #completeSelection
      if state.highlightedDate is defined
        ✖ updates states
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ calls props.onSelect
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      if state.highlightedDate is not defined
        ✖ does not update states
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ does not call props.onSelect
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

    #completeRangeSelection
      if state.highlightedRange is defined
        and its start and end are two different days
          ✖ updates states
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ calls props.onHighlight
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        and its start and end are the same day and props.singleDateRange is true
          ✖ updates states
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ calls props.onHighlight
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        and its start and end are the same day and props.singleDateRange is false
          ✖ does not update states
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

          ✖ calls props.onHighlight
            PhantomJS 1.9.8 (Mac OS X 0.0.0)
          TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
              at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

      if state.highlightedRange is not defined
        ✖ does not update states
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

        ✖ calls props.onHighlight
          PhantomJS 1.9.8 (Mac OS X 0.0.0)
        TypeError: 'undefined' is not a function (evaluating '_react2['default'].findDOMNode(this.component)')
            at /Users/John/workspace/onefinestay-datepicker/src/tests.webpack.js:42082

=============================== Coverage summary ===============================
Statements   : 97.23% ( 738/759 ), 18 ignored
Branches     : 91.08% ( 337/370 ), 25 ignored
Functions    : 97.27% ( 107/110 ), 2 ignored
Lines        : 95.09% ( 407/428 )
================================================================================

==================== Coverage / Threshold summary =============================
Statements   : 97.23% ( 738/759 ) Threshold : 90%, 18 ignored
Branches     : 91.08% ( 337/370 ) Threshold : 85%, 25 ignored
Functions    : 97.27% ( 107/110 ) Threshold : 90%, 2 ignored
Lines        : 95.09% ( 407/428 ) Threshold : 90%
================================================================================
[09:39:38] 'test-coverage' errored after 14 s
[09:39:38] Error: 1
    at formatError (/Users/John/workspace/onefinestay-datepicker/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/Users/John/workspace/onefinestay-datepicker/node_modules/gulp/bin/gulp.js:195:15)
    at Gulp.emit (events.js:107:17)
    at Gulp.Orchestrator._emitTaskDone (/Users/John/workspace/onefinestay-datepicker/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /Users/John/workspace/onefinestay-datepicker/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/Users/John/workspace/onefinestay-datepicker/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/Users/John/workspace/onefinestay-datepicker/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at removeAllListeners (/Users/John/workspace/onefinestay-datepicker/node_modules/karma/lib/server.js:336:7)
    at Server.<anonymous> (/Users/John/workspace/onefinestay-datepicker/node_modules/karma/lib/server.js:347:9)
    at Server.g (events.js:199:16)
    at Server.emit (events.js:129:20)
    at net.js:1421:10
    at process._tickCallback (node.js:355:11)

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/John/.nvm/versions/node/v0.12.13/bin/node" "/Users/John/.nvm/versions/node/v0.12.13/bin/npm" "run" "test"
npm ERR! node v0.12.13
npm ERR! npm  v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! react-daterange-picker@1.0.0 test: `gulp test-coverage`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-daterange-picker@1.0.0 test script 'gulp test-coverage'.
npm ERR! This is most likely a problem with the react-daterange-picker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp test-coverage
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-daterange-picker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls react-daterange-picker
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/John/workspace/onefinestay-datepicker/npm-debug.log
AlanFoster commented 8 years ago

Thanks for the headsup, I've got a PR to specify React 0.14 - #132

We should look at adding support to 0.15; We should update the codebase to use ReactDOM.findDOMNode rather than React.findDOMNode and see what other chances are required.

thathenderson commented 8 years ago

I opened up #135 which addresses these issues plus a couple more. Let me know if that works! @AlanFoster

AlanFoster commented 8 years ago

Fix merged into master, thanks for the hard work @thathenderson Will attempt to get this out soon

AlanFoster commented 7 years ago

This has been published under v1.1.0 - let me know if there's any further issues :+1: