test form elements in isolation
See original GitHub issueHello,
I have an input on which I use Decorator, it works well in browser, however when I try to test it without wrapping it in Form element I get Cannot read property 'attachToForm' of undefined
Is there a way to test form elements in isolation without having to wrap them in Form tag?
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Developing and Testing UI Components in Isolation
In this article we have focused on developing and testing UI components in isolation and various benefits of the mentioned approach.
Read more >7 Benefits of testing in isolation | CircleCI
Let's explore how isolation testing solves local dependency issues, improves accuracy, promotes clean production, enables continuous deployment, ...
Read more >Electrical isolation test - Wikipedia
An electrical isolation test is a Direct current (DC) or Alternating current (AC) resistance test that is performed between sub-circuit common and subsystem ......
Read more >Chapter 19. Test Isolation, and “Listening to Your Tests”
If we have a look through our form tests, we'll see that, actually, only item ➂ is tested explicitly. On items ➀ and...
Read more >Hindsight lessons about automation: Test isolation principle
Test isolation means – to develop and maintain tests that are logically isolated, therefore independent of any other tests that are run in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved this by creating a Formsy stub
Then in my test:
Something like this: https://gist.github.com/clayne11/1ae19045adf31ddf51b9868288aefda5
With the way I have exported the
TextField
component, you can import it into a test file and test it independently ofFormsy
.That being said, I don’t like the way
Formsy
uses functions rather than values. In certain situations props won’t update because the function hasn’t changed, even though the value has.I use a different HOC than the one included with Formsy. This is mine: