Skip to content

Tests fail when run on a weekend #137

Description

@procidac

It seems tests are making assumptions on the current date being on a weekday. I am running tests on a Sunday and they fail with these errors:

SUMMARY:
✔ 186 tests completed
✖ 11 tests failed

FAILED TESTS:
  The CalendarDate Component
    sets the correct class
      ✖ by defininig the expected class name
        PhantomJS 2.1.1 (Mac OS X 0.0.0)
      Expected 'DateRangePicker__Date DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date'.
      /onefinestay/react-daterange-picker/src/tests.webpack.js:203:62

      by setting the expected bem modifiers
        ✖ when the provided date is today
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--today DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date DateRangePicker__Date--today'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:212:64

        ✖ when the provided date is not today
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:219:64

      by setting the expected bem states
        ✖ when the isDisabled prop is passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--is-disabled DateRangePicker__Date--weekend DateRangePicker__Date--weekend--is-disabled' to equal 'DateRangePicker__Date DateRangePicker__Date--is-disabled'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:265:64

        ✖ when the isDisabled prop is not passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:272:64

        ✖ when the isHighlightedDate prop is passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--is-highlighted DateRangePicker__Date--weekend DateRangePicker__Date--weekend--is-highlighted' to equal 'DateRangePicker__Date DateRangePicker__Date--is-highlighted'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:279:64

        ✖ when the isHighlightedDate prop is not passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:286:64

        ✖ when the isSelectedDate prop is passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--is-selected DateRangePicker__Date--weekend DateRangePicker__Date--weekend--is-selected' to equal 'DateRangePicker__Date DateRangePicker__Date--is-selected'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:293:64

        ✖ when the isInSelectedRange prop is passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--is-selected DateRangePicker__Date--weekend DateRangePicker__Date--weekend--is-selected' to equal 'DateRangePicker__Date DateRangePicker__Date--is-selected'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:300:64

        ✖ when the isInHighlightedRange prop is passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--is-selected DateRangePicker__Date--weekend DateRangePicker__Date--weekend--is-selected' to equal 'DateRangePicker__Date DateRangePicker__Date--is-selected'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:307:64

        ✖ when the isSelectedDate, isInSelectedRange, isInHighlightedRange props are not passed in
          PhantomJS 2.1.1 (Mac OS X 0.0.0)
        Expected 'DateRangePicker__Date DateRangePicker__Date--weekend' to equal 'DateRangePicker__Date'.
        /onefinestay/react-daterange-picker/src/tests.webpack.js:316:64

This can be easily reproduced by setting the date to a Saturday or a Sunday. If I set my date to a weekday, tests are passing again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions