profile
viewpoint

Ask questionsFailing unit tests on macOS with German localization

<!-- IMPORTANT: If you do not provide a reproducible example (ie. via codepen.io), we likely won't be able to help you to the best of our abilities, and could automatically close this issue. -->

Current behavior

<Please describe here what faulty behavior you are experiencing> On macOS with German localization the unit tests fail.

Expected behavior

<Please describe here the expected behavior> The unit tests should succeed.

Steps to reproduce the problem

  1. clone autoNumeric and run yarn && yarn test
FAILED TESTS:
  The AutoNumeric object
    initialization methods
      ✖ should correctly initialize the AutoNumeric element when the `formatOnPageLoad` option is set
        Firefox 61.0.0 (Mac OS X 10.13.0)
      Expected '12234678.321' to equal '$12,234,678.32'.
      <Jasmine>
      ./test/unit/autoNumeric.spec.js/</</<@webpack://autonumeric/test/unit/autoNumeric.spec.js:1150:12 <- tests.webpack.js:9:705409
      <Jasmine>

  Initialization calls
    Initialize a single AutoNumeric object
      ✖ should fail to init when the default value is outside of the min and max limits
        PhantomJS 2.1.1 (Mac OS X 0.0.0)
      TypeError: undefined is not an object (evaluating 'aNInput.remove') in tests.webpack.js (line 9)
      webpack://autonumeric/webpack/universalModuleDefinition:1:0 <- tests.webpack.js:9:1481375
      <Jasmine>

  autoNumeric options and `options.*` methods
    `options.*` methods
      ✖ should correctly update the `decimalPlacesShownOnFocus` option
        Firefox 61.0.0 (Mac OS X 10.13.0)
      Expected '2.222,12 €' to equal '2.222,1235 €'.
      <Jasmine>
      ./test/unit/autoNumeric.spec.js/</</<@webpack://autonumeric/test/unit/autoNumeric.spec.js:1483:12 <- tests.webpack.js:9:734042
      <Jasmine>

  Instantiated autoNumeric functions
    `selectInteger`
      ✖ should select only the decimal part
        Firefox 61.0.0 (Mac OS X 10.13.0)
      Expected '12.266,123 €' to equal '12.266,123457 €'.
      <Jasmine>
      ./test/unit/autoNumeric.spec.js/</</<@webpack://autonumeric/test/unit/autoNumeric.spec.js:5157:12 <- tests.webpack.js:9:990807
      <Jasmine>

  The AutoNumeric event lifecycle
    ✖ should send the 'autoNumeric:formatted' event when formatting is done
      Firefox 61.0.0 (Mac OS X 10.13.0)
    Expected spy formattedEvent to have been called 6 times. It was called 5 times.
    <Jasmine>
    ./test/unit/autoNumeric.spec.js/</<@webpack://autonumeric/test/unit/autoNumeric.spec.js:8420:8 <- tests.webpack.js:9:1305434
    <Jasmine>

I'll try to investigate this further.

autoNumeric/autoNumeric

Answer questions AlexandreBonneau

Hey Daniel, were the bugs still happening when running the tests automatically/manually?

useful!

Related questions

Destroy multiple autonumeric hot 1
The selector did not select any valid DOM element. Please check on which element you called AutoNumeric. hot 1
On initialization, `allowDecimalPadding` option `'floats'` does not hide the decimal zeroes if set in the html attribute hot 1
Need option to indicate seed value is already localized hot 1
ajax double initialize hot 1
The value [] being set falls outside of the minimumValue [] and maximumValue [] range set for this element hot 1
`digitGroupSeparator` do not recognize the `'&#xA0;'` string hot 1
The value [] being set falls outside of the minimumValue [] and maximumValue [] range set for this element hot 1
Admit locales (es-ES, en-GB, etc.) to format the numbers hot 1
Setting `unformatOnSubmit` to `true` does not unformat the element on the form' `submit` event hot 1
Input value will undo on focusout when using only Ctrl+Backspace hot 1
'formulaMode: true' - not working hot 1
source:https://uonfu.com/
Github User Rank List