Fix failing unit tests related to time widget#1119
Fix failing unit tests related to time widget#1119edi9999 merged 1 commit intorjsf-team:masterfrom LucianBuzzo:fix-failing-tests
Conversation
|
For some reason this failed on travis |
|
@edi9999 Strange, I'm going to try and debug it |
|
One idea of mine is that for some reason Can you add a |
|
@edi9999 The test passes when using |
|
@edi9999 I was being stupid, it was actually another test that was failing -> https://github.com/mozilla-services/react-jsonschema-form/blob/master/test/StringField_test.js#L1007 I'll update it with the same fix |
It appears that due to the recent change from 2018 to 2019, there is one additional year in the select list, which caused the unit tests to fail. Signed-off-by: Lucian <lucian.buzzo@gmail.com>
|
Thanks @LucianBuzzo ! |
|
|
||
| expect(lengths).eql([ | ||
| 121 + 1, // from 1900 to 2020 + undefined | ||
| // from 1900 to current year + 2 (inclusive) + 1 undefined option |
There was a problem hiding this comment.
A nitpick - but would it make sense to extract a function that provides this, to avoid duplication between tests ?
There was a problem hiding this comment.
That is imo not really necessary, in tests duplication is not so bad.
Reasons for making this change
It appears that due to the recent change from 2018 to 2019, there is one additional year in the select list, which caused the unit tests to fail.
Checklist
npm run cs-formaton my branch to conform my code to prettier coding style