Open andrzejkrzywda opened 2 years ago
if you have no plans to introduce any JS framework, then what about https://viewcomponent.org/#testing as an alternative to Arbre
Hey @wasifhossain, that's a very good question.
I haven't used ViewComponent much yet - do they allow to write the view templates fully in Ruby? If so, then yes, that could be a good alternative to consider here.
What I like about ViewComponent in this project is that it's more popular. More contributors would be familiar with this.
However, the goal is to have everything testable and "mutation-coverable". While I see that it's easy to test view components, I'm not sure how we can employ mutant here. The template code is not possible to mutation-cover, to my knowledge.
This may lead to a situation where we can write tests for views, but we don't know if we wrote enough of them. Which can lead to regressions during refactorings etc.
Maybe there's a solution, to somehow combine a tool like Arbre or Phlex (templates in Ruby) with the ViewComponents approach, but I'm not sure what would be the benefit of adding VC to our puzzles here in that case.
To be clear - right now, we're still not mutation testing the views, but we're close to this.
Any thoughts?
As a shortcut we now use erb views, which is inconsistent with other client views.