forcedotcom / LightningTestingService

Apache License 2.0
122 stars 35 forks source link

lightning:input.showHelpMessageIfInvalid runtime error #64

Closed ghiblin closed 4 years ago

ghiblin commented 6 years ago

I don't think these is the right place to post this, but running my tests I step in this problem:

Action failed: lightning:input$controller$showHelpMessageIfInvalid [Unable to get property 'validity' of undefined or null reference]

In the test case I set an object to my component, that is binded with a list of lightning:input by value property:

then I fire the press event on my save button that, in the end, call let allValid = cmp.find('fields').reduce((acc, el) => { el.showHelpMessageIfInvalid(); return acc && el.get('v.validity').valid; }, true); and so I get the runtime error.

esalman-sfdc commented 6 years ago

Looks like an issue with the lightning:input component as the error is being encountered by that component when you invoke showHelpMessageIfInvalid() on one of the input components on your form.

Can you please narrow down the type of input which is encountering the issue (you could probably do that by logging it before calling el.showHelpMessageIfInvalid() inside your reducer). I can then try checking with the team which owns the component.