Merge pull request #8991 from jibees/8985-Make-checkbox-for-Send-a-cancellation-email-to-the-customer-checked-by-default

Admin, editing order, on last item deletion modal: "Send a cancellation email to the customer" checked by default
This commit is contained in:
Filipe
2022-04-18 14:04:08 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -201,7 +201,7 @@ ofnCancelOrderAlert = function(callback, i18nKey) {
$('#custom-confirm .message').html(
` ${t(i18nKey)}
<div class="form">
<input type="checkbox" name="send_cancellation_email" value="1" id="send_cancellation_email" />
<input type="checkbox" name="send_cancellation_email" value="1" id="send_cancellation_email" checked="true" />
<label for="send_cancellation_email">${t("js.admin.orders.cancel_the_order_send_cancelation_email")}</label>
</div>`);
$('#custom-confirm button.confirm').unbind( "click" ).click(() => {

View File

@@ -172,6 +172,7 @@ describe '
context "it shows a second modal about last item deletion and therefore about order cancellation" do
it "that the user can close and then nothing change" do
expect(page).to have_content "This will cancel the current order."
expect(page).to have_checked_field "Send a cancellation email to the customer"
within(".modal", visible: true) do
click_on("Cancel")
end
@@ -184,6 +185,7 @@ describe '
it "and then the order is cancelled and no email is sent by default" do
expect do
within(".modal", visible: true) do
uncheck("send_cancellation_email")
click_on("OK")
end
expect(page).to have_content "Cannot add item to canceled order"
@@ -195,7 +197,6 @@ describe '
it "and check the checkbox to send an email to the customer about its order cancellation" do
expect do
within(".modal", visible: true) do
check("send_cancellation_email")
click_on("OK")
end
expect(page).to have_content "Cannot add item to canceled order"