-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f3b123
commit f4e541b
Showing
24 changed files
with
385 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ApplicationViewComponentPreview < ViewComponentContrib::Preview::Base | ||
self.abstract_class = true | ||
|
||
layout 'component_preview' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%= @form.radio_button @attribute, @title, class: "js-table-filter-btn", checked: true, style: @style, id: @checkbox_id, data: { **data_attributes} %> | ||
<%= @form.radio_button @attribute, @title, class: "js-table-filter-btn", checked: true, style: @style, id: @checkbox_id, data: { **data_attributes} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg width="10" height="7" viewBox="0 0 10 7" fill="white" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M4.50581 5.82828L0.505807 1.82828C0.232439 1.55491 0.232439 1.11169 0.505807 0.838326C0.779174 0.564959 1.22239 0.564959 1.49576 0.838326L5.00078 4.34335L8.50581 0.838326C8.77917 0.564959 9.22239 0.564959 9.49576 0.838326C9.76912 1.11169 9.76912 1.55491 9.49576 1.82828L5.49576 5.82828C5.22239 6.10164 4.77917 6.10164 4.50581 5.82828Z"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg width="10" height="12" viewBox="0 0 10 12" fill="white" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M6.85524 6.35494C7.34544 5.96927 7.70324 5.4404 7.87886 4.84191C8.05449 4.24342 8.0392 3.60507 7.83514 3.01567C7.63107 2.42628 7.24837 1.91514 6.74028 1.55337C6.23219 1.1916 5.62397 0.997192 5.00024 0.997192C4.37652 0.997192 3.7683 1.1916 3.26021 1.55337C2.75212 1.91514 2.36941 2.42628 2.16535 3.01567C1.96128 3.60507 1.946 4.24342 2.12162 4.84191C2.29725 5.4404 2.65505 5.96927 3.14524 6.35494C2.30528 6.69146 1.57239 7.24961 1.02469 7.9699C0.476991 8.69018 0.135024 9.54559 0.0352425 10.4449C0.0280198 10.5106 0.0338008 10.577 0.0522552 10.6405C0.0707096 10.7039 0.101476 10.7631 0.142798 10.8146C0.226252 10.9187 0.347634 10.9854 0.480243 10.9999C0.612851 11.0145 0.745822 10.9758 0.849905 10.8924C0.953988 10.8089 1.02066 10.6875 1.03524 10.5549C1.14503 9.57754 1.61109 8.67485 2.34435 8.01934C3.07762 7.36383 4.02669 7.00145 5.01024 7.00145C5.99379 7.00145 6.94287 7.36383 7.67613 8.01934C8.4094 8.67485 8.87545 9.57754 8.98524 10.5549C8.99884 10.6778 9.05746 10.7913 9.1498 10.8734C9.24213 10.9556 9.36163 11.0007 9.48524 10.9999H9.54024C9.67131 10.9849 9.79111 10.9186 9.87352 10.8156C9.95594 10.7125 9.9943 10.5811 9.98024 10.4499C9.87999 9.54804 9.53618 8.69043 8.98567 7.96904C8.43515 7.24765 7.6987 6.68968 6.85524 6.35494ZM5.00024 5.99994C4.60468 5.99994 4.218 5.88264 3.8891 5.66288C3.5602 5.44312 3.30386 5.13076 3.15248 4.76531C3.00111 4.39986 2.9615 3.99772 3.03867 3.60976C3.11584 3.2218 3.30632 2.86543 3.58603 2.58573C3.86573 2.30602 4.2221 2.11554 4.61006 2.03837C4.99802 1.9612 5.40016 2.00081 5.76561 2.15218C6.13106 2.30356 6.44342 2.5599 6.66318 2.8888C6.88294 3.2177 7.00024 3.60438 7.00024 3.99994C7.00024 4.53037 6.78953 5.03908 6.41446 5.41415C6.03938 5.78923 5.53068 5.99994 5.00024 5.99994Z"/> | ||
</svg> |
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
...ystem/components/common/button_to_test.rb → test/components/common/button_to_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/system/components/common/footer_test.rb → test/components/common/footer_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "test_helper" | ||
|
||
class Common::Form::RadioButton::ComponentTest < ViewComponent::TestCase | ||
include ActionView::Helpers::FormHelper | ||
|
||
def test_render_component | ||
form = ActionView::Helpers::FormBuilder.new(route.auctions_path, nil, self, { }) | ||
|
||
render_inline(Common::Form::RadioButton::Component.new( | ||
form: form, title: 'blind', attribute: :type, | ||
data_attributes: { }, options: { style: 'visibility: hidden; position: absolute;', id: 'filter_PO_button'} | ||
)) | ||
|
||
assert_selector 'input.js-table-filter-btn[type="radio"][id="filter_PO_button"][value="blind"][name="/auctions[type]"][checked="checked"]', visible: :all | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "test_helper" | ||
|
||
class Common::Form::SearchField::ComponentTest < ViewComponent::TestCase | ||
include ActionView::Helpers::FormHelper | ||
|
||
def test_render_component | ||
form = ActionView::Helpers::FormBuilder.new(route.auctions_path, nil, self, { }) | ||
|
||
render_inline(Common::Form::SearchField::Component.new( | ||
form: form, attribute: :domain_name, value: nil, placeholder: I18n.t('search_by_domain_name') | ||
)) | ||
|
||
assert_selector "input.c-table__search__input.js-table-search-dt[type='search'][name='/auctions[domain_name]'][id='_auctions_domain_name'][placeholder='#{I18n.t('search_by_domain_name')}']" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require "test_helper" | ||
|
||
class HeroTest < ViewComponent::TestCase | ||
def test_render_component | ||
render_inline(Common::Hero::Component.new(title: 'Test', )) | ||
|
||
assert_selector 'h1.c-hero__content__title', text: 'Test' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
require "test_helper" | ||
|
||
class LinkButtonTest < ViewComponent::TestCase | ||
def setup | ||
@auction = auctions(:valid_with_offers) | ||
end | ||
|
||
def test_render_component | ||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue-secondary', data_attributes: { } ) | ||
) | ||
|
||
assert_selector "a.c-btn.c-btn--blue-secondary[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
end | ||
|
||
def test_render_nested_component | ||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue-secondary', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
|
||
assert_selector "a.c-btn.c-btn--blue-secondary.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
end | ||
|
||
|
||
def test_inline_button_colorize | ||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue-secondary', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--blue-secondary[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'green', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--green[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--blue[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'orange', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--orange[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'black', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--black[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'ghost', data_attributes: { } ) | ||
) | ||
assert_selector "a.c-btn.c-btn--ghost[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Link' | ||
end | ||
|
||
def test_nested_button_colorize | ||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue-secondary', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--blue-secondary.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'green', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--green.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'blue', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--blue.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'orange', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--orange.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'black', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--black.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
|
||
render_inline(Common::Links::LinkButton::Component.new( | ||
link_title: 'Link', href: route.new_auction_english_offer_path(auction_uuid: @auction.uuid), | ||
color: 'ghost', data_attributes: { } ) | ||
) do | ||
'Edit' | ||
end | ||
assert_selector "a.c-btn.c-btn--ghost.c-btn--icon[href='#{route.new_auction_english_offer_path(auction_uuid: @auction.uuid)}']", text: 'Edit' | ||
end | ||
end |
Oops, something went wrong.