Reply To: Filled TextInput

PennController for IBEX Forums Support Filled TextInput Reply To: Filled TextInput

#6775
Jeremy
Keymaster

Hi Kathy,

This is because you’re testing that the content of your “country” TextInput should be empty: whenever you click the button and there is at least one character in that input box, your last test will fail and accordingly print the ‘errorcountry’ Text element. Because all the ands are attached to the first test on “job,” whenever one test fails it systematically triggers failure for that first one too (the “parent”), hence the printing of the “errorjob” Text element.

So the solution is to make your test on ‘country’ check that there’s at least one character in the input box (see this message above) and, if you want to make each test’s failure independent from one another, you can insert a dummy test as the parent and make all the other ones children of that test:

newFunction('dummy', ()=>true).test.is(true)
// age
.and( getTextInput("age").test.text(/^\d+$/)
// ...

(Note that you no longer need to move the last test up to the top of the stack in order for the error messages to show in the correct order, now that we’re using a dummy test as the parent)

I have updated the code at the project whose demonstration link I shared in my previous post

Jeremy