← Graph

Do you unit test ViewComponents?

question 3 connections

Audience asks whether Radoslav Stankov writes unit tests for ViewComponents, given that testability is often cited as their main advantage. Answer: no unit tests. He writes Capybara smoke tests that visit every Lookbook preview page and assert it doesn't blow up, plus end-to-end tests for all business logic. More complex logic is pushed into business service objects and tested there. For a real component library he would add visual regression (screenshot-diff) tests on top of previews.

answer_summary
No unit tests; Capybara smoke tests over Lookbook previews plus end-to-end business tests.
question Do you unit test ViewComponents?
about
Asks about testability of ViewComponents.
question Do you unit test ViewComponents?
about
Lookbook tool
Answer centers on smoke testing Lookbook previews.
question Do you unit test ViewComponents?
asked_at
Second audience question during Q&A.

Provenance

Read by
1 extraction