Skip to content

Commit

Permalink
Convert tiered promotion calculator buttons to anchors
Browse files Browse the repository at this point in the history
Buttons block the surrounding form from being submitted by enter key.
Instead the enter key leads to tiers being added. Using anchors instead.
  • Loading branch information
tvdeyen committed Jan 10, 2018
1 parent dac6cbd commit 6162a54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
'form-prefix' => prefix,
'calculator' => 'tiered_flat_rate'
} %>
<button class="button js-add-tier"><%= t('spree.actions.add') %></button>
<a class="button js-add-tier"><%= t('spree.actions.add') %></a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
'form-prefix' => prefix,
'calculator' => 'tiered_percent'
} %>
<button class="button js-add-tier"><%= t('spree.actions.add') %></button>
<a class="button js-add-tier"><%= t('spree.actions.add') %></a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
expect(page).to have_content("Base Percent")
expect(page).to have_content("Tiers")

click_button "Add"
page.find('a.button').click
end

fill_in "Base Percent", with: 5
Expand Down

0 comments on commit 6162a54

Please sign in to comment.