rails-dom-testing VS view_component

Compare rails-dom-testing vs view_component and see what are their differences.

rails-dom-testing

Extracting DomAssertions and SelectorAssertions from ActionView. (by rails)

view_component

A framework for building reusable, testable & encapsulated view components in Ruby on Rails. (by ViewComponent)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
rails-dom-testing view_component
3 74
172 3,161
3.5% 1.1%
7.8 8.9
4 months ago 7 days ago
Ruby Ruby
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

rails-dom-testing

Posts with mentions or reviews of rails-dom-testing. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-05.
  • Did you know Nokogiri now has opt-in HTML5 parsing?
    7 projects | /r/ruby | 5 Jun 2023
    Switching to HTML5 parsing for everything is a very good idea, but in a lot of cases it's not straightforward because -- blurgh -- people tend to write unit tests that assert on the exact output string. Currently Discourse is dealing with this, and I've started work to upgrade Mastodon and am hitting similar problems. (Worth noting that Rails provides a test helper, assert_dom_equals, that should cover the majority of use cases.)
  • https://np.reddit.com/r/rails/comments/mfj94y/is_there_a_way_to_unit_test_a_regular_view/gsujvx5/
    1 project | /r/backtickbot | 30 Mar 2021
    class SomeViewTest < ActiveSupport::TestCase include Rails::Dom::Testing::Assertions::SelectorAssertions def test_some_view html = ActionController::Base.new.render_to_string "shared/_progress_indicator", layout: false, locals: { percent: 9 } # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc. end end
  • Is there a way to unit test a regular view ?
    2 projects | /r/rails | 29 Mar 2021
    # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc.

view_component

Posts with mentions or reviews of view_component. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-01.

What are some alternatives?

When comparing rails-dom-testing and view_component you can also consider the following projects:

loofah - Ruby library for HTML/XML transformation and sanitization

Stimulus - A modest JavaScript framework for the HTML you already have

turbo-rails - Use Turbo in your Ruby on Rails app

Tailwind CSS - A utility-first CSS framework for rapid UI development.

cypress-rails - Helps you write Cypress tests of your Rails app

hotwire-rails - Use Hotwire in your Ruby on Rails app

i18n-tasks - Manage translation and localization with static analysis, for Ruby i18n

Ruby on Rails - Ruby on Rails

Rack::Attack - Rack middleware for blocking & throttling

turbo - The speed of a single-page web application without having to write any JavaScript

Avo - Build Ruby on Rails apps 10x faster

Roda - Routing Tree Web Toolkit