cliff-effects icon indicating copy to clipboard operation
cliff-effects copied to clipboard

Comprehensive tests for `ManagedNumberField`

Open knod opened this issue 7 years ago • 4 comments

This is what I've got so far for <ManagedNumberField> desired behavior.

Valid number: A positive decimal or whole number, 0, or a blank field. Permitted invalid input: Numbers with multiple decimal points.

  • [ ] User clicks on field with '0' in it:
    • [ ] Field goes blank, ready for input
  • [ ] User clicks on field with valid number in it:
    • [ ] Nothing changes
  • [ ] User types a valid number in the field:
    • [ ] Typing shows up as entered
  • [ ] User types a valid number in the field and then leaves the field:
    • [ ] Valid value is shown as decimal value
    • [ ] (Valid value is stored permanently)
  • [ ] User types an INVALID number in the field:
    • [ ] Typing shows up as entered
    • [ ] Field gives 'invalid value' feedback (turns red)
  • [ ] User types in an INVALID number and then leaves the field
    • [ ] The last valid field value previously entered is shown (last valid value typed, or last valid value left there?)
    • [ ] (Invalid value is discarded)
  • [ ] User types 0 in a field:
    • [ ] Typing shows up as entered
  • [ ] User deletes all items in the field
    • [ ] Input does not turn red
  • [ ] User deletes all numbers in the field then leaves the field
    • [ ] Field shows '0'
    • [ ] (0 is stored permanently as the value)

Which of these are done already?

knod avatar Jul 09 '18 11:07 knod

Of what's currently here, the dev branch currently contains this functionality, except for:

User types an INVALID number in the field User types in an INVALID number and then leaves the field

For the above two -- per the most recent PRs, when the user attempts to enter an invalid value (e.g. a negative sign or a letter), the last field value previously entered does not change. The negative sign/letter does not get put into the input at all.

I'll work on making sure there are complete tests for these behaviors.

snyderc avatar Jul 11 '18 01:07 snyderc

@snyderc : Thanks! Also, if you have a sec, if you could put check marks in the ones that are already done, it would show it in the issue list view so others can quickly know where it's at.

knod avatar Jul 11 '18 11:07 knod

Do you want me to use the checkboxes for when the tests are completed, or just when the code exhibits these behaviors? I will assume the first one.

snyderc avatar Jul 11 '18 15:07 snyderc

Yeah, @snyderc, the first one - check them off when the tests for that behavior have been completed.

knod avatar Jul 11 '18 16:07 knod