Improve HTML to improve tests readability

- Specify `for` attribute to `<label />` element
- Initialize component with its default value

So, it's linked to its `<input />`
This commit is contained in:
Jean-Baptiste Bellet
2021-04-01 21:50:31 +02:00
parent 93ebfb6a4f
commit 1674c6a252

View File

@@ -15,17 +15,17 @@
{include_blank: true, class: 'select2', 'ng-model' => 'q.state_eq'})
.four.columns
.field
= label_tag nil, t(:order_number)
= label_tag "q_number_cont", t(:order_number)
= text_field_tag "q[number_cont]", nil, "ng-model" => "q.number_cont", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
.field
= label_tag nil, t(:email)
= label_tag "q_email_cont", t(:email)
= email_field_tag "q[email_cont", nil, "ng-model" => "q.email_cont", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
.four.columns
.field
= label_tag nil, t(:first_name_begins_with)
= label_tag "q_bill_address_firstname_start", t(:first_name_begins_with)
= text_field_tag "q[bill_address_firstname_start]", nil, size: 25, "ng-model" => "q.bill_address_firstname_start", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
.field
= label_tag nil, t(:last_name_begins_with)
= label_tag "q_bill_address_lastname_start", t(:last_name_begins_with)
= text_field_tag "q[bill_address_lastname_start]", nil, size: 25, "ng-model" => "q.bill_address_lastname_start", "ng-keypress" => "$event.keyCode === 13 && fetchResults()"
.omega.four.columns
.field.checkbox
@@ -36,7 +36,7 @@
= label_tag nil, t(:shipping_method)
= select_tag("shipping_method_id",
options_for_select(Spree::ShippingMethod.managed_by(spree_current_user).collect {|s| [t("spree.shipping_method_names.#{s.name}"), s.id]}),
{include_blank: true, class: 'select2', 'ng-model' => 'shipping_method_id'})
{include_blank: true, class: 'select2', 'ng-model' => 'shipping_method_id', 'ng-value' => 'shipping_method_id'})
.field-block.alpha.eight.columns
= label_tag nil, t(:distributors)
= select_tag("q[distributor_id_in]",