There's was an overlooked behavior inconsistency between the assignment of this.state.currentEnthusiasm assigment at the Hello component constructor and the expect behavior in the test 'throws when the enthusiasm level is 0'.
I fixed the assignment rather than the test itself so that the wanted behavior will work. When enthusiamLevel is 0 it will now actually throw and error instead of bypassing the falsy value and setting this.state.currentEnthusiasm to 1.
There's was an overlooked behavior inconsistency between the assignment of
this.state.currentEnthusiasm
assigment at the Hello component constructor and the expect behavior in the test 'throws when the enthusiasm level is 0'.I fixed the assignment rather than the test itself so that the wanted behavior will work. When
enthusiamLevel
is 0 it will now actually throw and error instead of bypassing thefalsy
value and settingthis.state.currentEnthusiasm
to 1.