Skip to content

Commit

Permalink
use section for card component
Browse files Browse the repository at this point in the history
  • Loading branch information
martinemde committed Nov 22, 2024
1 parent 06be3a1 commit 2db498a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/components/card_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CardComponent < ApplicationComponent
def view_template(&)
color = "bg-white dark:bg-black border border-neutral-200 dark:border-neutral-800 text-neutral-900 dark:text-white "
box = "w-full px-4 py-6 md:p-10 mb-10 rounded-md shadow overflow-hidden"
article(**classes(color, box), &)
section(**classes(color, box), &)
end

def head(title = nil, icon: nil, count: nil, url: nil, **options, &block)
Expand Down
4 changes: 2 additions & 2 deletions test/views/card_component_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def render(...)
end
end

assert_selector "article"
assert_selector "section"
assert_selector "h3", text: "Gems"
assert_selector "svg.fill-orange"
assert_selector "span", text: "3"
Expand All @@ -36,7 +36,7 @@ def render(...)
end
end

assert_selector "article"
assert_selector "section"
assert_selector "h3", text: "History"
assert_text "content"
refute_text "View all"
Expand Down

0 comments on commit 2db498a

Please sign in to comment.