Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail when run on a weekend #137

Closed
procidac opened this issue May 8, 2016 · 2 comments
Closed

Tests fail when run on a weekend #137

procidac opened this issue May 8, 2016 · 2 comments

Comments

@procidac
Copy link

procidac commented May 8, 2016

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.

@procidac
Copy link
Author

procidac commented May 8, 2016

Also reproduced when pushing a new commit to this PR: #136

@AlanFoster
Copy link
Member

Good catch @procidac

Mind reviewing #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants