react-styled-select icon indicating copy to clipboard operation
react-styled-select copied to clipboard

Trying to test it with react-test-renderer does not work

Open vladejs opened this issue 7 years ago • 7 comments

Just importing the component gives error:

 ReferenceError: MutationObserver is not defined
      
      at Object.<anonymous> (node_modules/@webcomponents/shadydom/shadydom.min.js:16:377)
      at Object.<anonymous> (node_modules/@webcomponents/shadydom/shadydom.min.js:66:338)
      at Object.<anonymous>.Object.defineProperty.value (node_modules/react-styled-select/lib/Select/Select.js:5:986)
      at Object.<anonymous> (node_modules/react-styled-select/lib/Select/Select.js:13:3)
      at Object.<anonymous>.Object.defineProperty.value (node_modules/react-styled-select/lib/index.js:5:40)
      at Object.<anonymous> (node_modules/react-styled-select/lib/index.js:13:3)
      at Object.<anonymous> (src/components/common/select/select.js:2:26)
      at Object.<anonymous> (src/__tests__/select.test.js:5:15)
          at Generator.next (<anonymous>)
          at Promise (<anonymous>)
          at Generator.next (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

vladejs avatar Dec 13 '17 17:12 vladejs

Having this same problem. Any progress on this?

BTW: Quick solve was to downgrade the version (for anyone coming across this open issue).

iansolano avatar Feb 26 '18 15:02 iansolano

Hi, sorry about that, I will see it as soon as possible!

agutoli avatar Feb 26 '18 17:02 agutoli

@vladejs @iansolano I have not any info about how can I reproduce this problem, but I did some research about this error and I did some fixes, can you test it please?

If still have the problem, can you say what test engine are you using (Jest or mocha or karma)? React Versions etc?

Tks

agutoli avatar Mar 02 '18 17:03 agutoli

new version 2.2.5-beta

agutoli avatar Mar 02 '18 17:03 agutoli

@agutoli just tested, still the same error. Using Jest "jest": "20.0.4" and "react": "^16.2.0". Also tested with the latest stable release of jest 22.3.0 and received the same MutationObserver error.

The 2.1.2-alpha release works fine with my current configuration. Hopefully that helps. Thanks for following up.

iansolano avatar Mar 02 '18 20:03 iansolano

@iansolano I just did a new fix, can you try it please? tks

new version 2.2.6-beta

agutoli avatar Mar 03 '18 00:03 agutoli

@agutoli sorry about the delay. Still failing: image

image

This is the install from 2.1.2-alpha: image

I wonder if the version of react-shadow is a problem here? I don't know. Sorry, ATM I don't really have the time to look into this and help out. If I find some free time I'll try to take a look. Hopefully this helps.

iansolano avatar Mar 06 '18 14:03 iansolano