From f990196ca9e41666462ced2e58ef53bd517bc0e8 Mon Sep 17 00:00:00 2001 From: Meghan Chua <17057809+malchua@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:35:46 -0600 Subject: [PATCH] Fix component preview --- ...form_prefixed_select2_component_preview.rb | 2 +- .../default.html.erb | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/components/previews/viral_form_prefixed_select2_component_preview.rb b/test/components/previews/viral_form_prefixed_select2_component_preview.rb index 87b8df9878..4688c9ebc2 100644 --- a/test/components/previews/viral_form_prefixed_select2_component_preview.rb +++ b/test/components/previews/viral_form_prefixed_select2_component_preview.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -class ViralFormPrefixedSelectComponentPreview < ViewComponent::Preview +class ViralFormPrefixedSelect2ComponentPreview < ViewComponent::Preview def default; end end diff --git a/test/components/previews/viral_form_prefixed_select2_component_preview/default.html.erb b/test/components/previews/viral_form_prefixed_select2_component_preview/default.html.erb index 62bab824de..8f70b58801 100644 --- a/test/components/previews/viral_form_prefixed_select2_component_preview/default.html.erb +++ b/test/components/previews/viral_form_prefixed_select2_component_preview/default.html.erb @@ -1,16 +1,18 @@ <%= form_with(url: "", data: {controller: "viral--select2"}) do |form| %> - <%= viral_prefixed_select2(form:, name: :user) do |select| %> - <% (1..50).each do |num| %> - <% select.with_option( - primary: "User #{num}", - secondary: "Another fact goes here", - value: num, - ) %> - <%= select.with_empty_state do %> - No users found +