40818419 / react-code-input

React component for entering and validating PIN code.
MIT License
314 stars 129 forks source link

Snapshot testing impossible #80

Open kembala opened 4 years ago

kembala commented 4 years ago

Generated uuid/v4 id makes it impossible to use snapshot testing, I suggest to replace {this.uuid}+[incrementedCount] call in id of inputs to optional name prop like {[this.name]-[incrementedCount]}

kembala commented 4 years ago

Here is a workaround for those interested - Not solution though const mockMath = Object.create(global.Math); mockMath.random = () => 1; global.Math = mockMath;