You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An issue has been discovered through a couple of the scenarios in the 'Search for a page' tests now failing with the new search component.
The tests are failing because a NZ formatted date (DD-MM-YYYY) is being provided to a non HTML5 date field which is not being localised and functioning in the default US format (MM-DD-YYYY) – thus when a NZ date is provided to the field the date is parsed incorrectly and the test fails.
@unclecheese and I have done some investigation into this and the problem is three-fold:
The date format provided by the Basic Context (for behat provided by silverstripe-behat-extension) is hard coded to the NZ date format 'd-m-Y' but the default member and date format is 'd-m-Y', @unclecheese has investigated this and has a solution to make context aware of locale.
moment.js locales are not loaded into the vendor.js bundle – this means that during yarn test or yarn watch moment has access to all it's locals but when you run yarn build momentjs doesn't have access to any of it's locale files and therefore falls back to the default 'en' (US) locale, this is what's blocking us from fixing the behat tests at the moment.
@unclecheese and I have investigated including all the locales into the build but this would add ~200k to the build size which is not desirable. We have identified that the solution will either be adding a SS JS requirement on page load based on member locale or possibly look at replacing momentjs with another library which handles localisation differently (possiblydate-fns)
The text was updated successfully, but these errors were encountered:
An issue has been discovered through a couple of the scenarios in the 'Search for a page' tests now failing with the new search component.
The tests are failing because a NZ formatted date (DD-MM-YYYY) is being provided to a non HTML5 date field which is not being localised and functioning in the default US format (MM-DD-YYYY) – thus when a NZ date is provided to the field the date is parsed incorrectly and the test fails.
@unclecheese and I have done some investigation into this and the problem is three-fold:
The date format provided by the Basic Context (for behat provided by silverstripe-behat-extension) is hard coded to the NZ date format 'd-m-Y' but the default member and date format is 'd-m-Y', @unclecheese has investigated this and has a solution to make context aware of locale.
Date fields have a number of problems:
yarn test
oryarn watch
moment has access to all it's locals but when you runyarn build
momentjs doesn't have access to any of it's locale files and therefore falls back to the default 'en' (US) locale, this is what's blocking us from fixing the behat tests at the moment.@unclecheese and I have investigated including all the locales into the build but this would add ~200k to the build size which is not desirable. We have identified that the solution will either be adding a SS JS requirement on page load based on member locale or possibly look at replacing momentjs with another library which handles localisation differently (possiblydate-fns)
The text was updated successfully, but these errors were encountered: