Replies: 4 comments 4 replies
-
@mollerhoj good idea! Currently, ViewComponent tests do not involve a browser, and thus do not support interactions.
I could see us leveraging ViewComponent previews to do browser-based testing, which would also help ensure previews are properly tested! Does this spark any ideas @juanmanuelramallo ? |
Beta Was this translation helpful? Give feedback.
-
Okay, @joelhawksley and @juanmanuelramallo. I run into the issue that the previews don't seem to be available for tests. I get a routing error:
Adding the route to |
Beta Was this translation helpful? Give feedback.
-
Hi @mollerhoj ! Did you manage to use Capybara Actions like 'click' within your ViewComponent tests? I have been extremely happily using the previews for development no problem, and Rspec matchers, but can't quite get the Actions to work. |
Beta Was this translation helpful? Give feedback.
-
Any luck doing any integration/system testing this way? I have a component that touches a few different models, and I'd like to run a system-type test of the component in isolation. I saw a wrapbook engineering blog post leveraging previews for interaction testing, but it seemed that was mostly frontend interaction via Stimulus controllers: https://wrapbook.engineering/system-testing-view-components.html |
Beta Was this translation helpful? Give feedback.
-
The capybara matchers a included by default. Any reason why the Capybara interactions are not? I would be awesome to be able to render the components separately (As done in previews) and use Capybara methods link
click_on ...
etc to test the functionality of complex components.Has anybody experimented with this?
Beta Was this translation helpful? Give feedback.
All reactions