phetsims / fourier-making-waves

"Fourier: Making Waves" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 3 forks source link

State wrapper error in ZoomLevelProperty #221

Open pixelzoom opened 2 years ago

pixelzoom commented 2 years ago

When fuzz testing the State wrapper with phet-io-wrappers/state/?sim=fourier-making-waves&phetioDebug&fuzz, this error occurs:

assert.js:25 Uncaught Error: Assertion failed: Property value not valid: value failed isValidValue: 5
    at window.assertions.assertFunction (assert.js:25:13)
    at Function.isValueValid (ValidatorDef.ts:326:39)
    at validate (validate.ts:37:18)
    at Property.ts:183:34
    at TinyProperty.emit (TinyEmitter.ts:93:9)
    at ZoomLevelProperty._notifyListeners (Property.ts:285:23)
    at ZoomLevelProperty.set (Property.ts:217:14)
    at ZoomLevelProperty.set value [as value] (Property.ts:355:10)
    at listener (ZoomButtonGroup.ts:80:9)
    at TinyEmitter.emit (TinyEmitter.ts:93:9)

Some problems:

    super( axisDescriptions.indexOf( axisDescriptionProperty.value ), {
      range: new Range( 0, axisDescriptions.length - 1 ),
      isValidValue: value => value >= 0 && value < axisDescriptions.length
    } );
pixelzoom commented 2 years ago

I made improvements identified in the above commit, and the State wrapper is still failing fuzz testing.

I'm not going to spend more time on this now, will come back to it when we work on this sim again.