Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightning input mock is missing some methods #21

Closed
mattgoldspink opened this Issue Feb 12, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@mattgoldspink
Copy link
Contributor

mattgoldspink commented Feb 12, 2019

The ones we need specifically are checkValidity,setCustomValidity and reportValidity but it looks like it's missing a few others too.

The other question we had was around the behaviour of the @api validity property. From testing at runtime it seems this is always populated with a default object for us, but during testing it's empty. I understand it can be populated during our tests manually, but it would be nice to have it initialized with the same default as the real component.

screen shot 2019-02-12 at 4 36 34 pm

@trevor-bliss

This comment has been minimized.

Copy link
Contributor

trevor-bliss commented Feb 12, 2019

Thanks for the issue and the PR to fix! FWIW I'll be working on a new script to generate the mocks soon that should be much more reliable (the metadata file the mocks are currently generated off of is not 100% up to date). The new script should catch these missing methods going forward.

Regarding the validity property, according to the documentation this prop should be updated to an object with a bunch of boolean attributes like badInput, customError, etc. Is that what you're seeing at runtime or is it really an empty object?

@trevor-bliss

This comment has been minimized.

Copy link
Contributor

trevor-bliss commented Feb 13, 2019

@mattgoldspink To clarify though, if you remove the validity instantiation from your PR I'll merge it. It's a good fix until the new script is in place.

@mattgoldspink

This comment has been minimized.

Copy link
Contributor Author

mattgoldspink commented Feb 15, 2019

@trevor-bliss Sorry for the delay, got sucked into other priorities. I fixed the validity field and updated the PR. Let me know if there's anything else needed.

@trevor-bliss

This comment has been minimized.

Copy link
Contributor

trevor-bliss commented Feb 15, 2019

@mattgoldspink No worries, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.