File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Checkout/view/frontend/web/js
Customer/view/frontend/templates/address
dev/tests/integration/testsuite/Magento/Customer/Block/Address Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ define([
238
238
239
239
// Add defaultvalue attribute to state/province select element
240
240
regionList . attr ( 'defaultvalue' , this . options . defaultRegion ) ;
241
+ this . options . form . find ( '[type="submit"]' ) . removeAttr ( 'disabled' ) . show ( ) ;
241
242
} ,
242
243
243
244
/**
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ $viewModel = $block->getViewModel();
202
202
<button type="submit"
203
203
class="action save primary"
204
204
data-action="save-address"
205
+ disabled="disabled"
205
206
title="<?= $ escaper ->escapeHtmlAttr (__ ('Save Address ' )) ?> ">
206
207
<span><?= $ escaper ->escapeHtml (__ ('Save Address ' )) ?> </span>
207
208
</button>
Original file line number Diff line number Diff line change @@ -204,4 +204,18 @@ public function testCheckPostCodeLabels(): void
204
204
)
205
205
);
206
206
}
207
+
208
+ /**
209
+ * Check that submit button is disabled
210
+ *
211
+ * @magentoDataFixture Magento/Customer/_files/customer.php
212
+ * @magentoDataFixture Magento/Customer/_files/customer_address.php
213
+ * @return void
214
+ */
215
+ public function testSubmitButtonIsDisabled (): void
216
+ {
217
+ $ html = $ this ->block ->toHtml ();
218
+ $ buttonXpath = "//form[contains(@class, 'form-address-edit')]//button[@type='submit' and @disabled='disabled'] " ;
219
+ $ this ->assertEquals (1 , Xpath::getElementsCountForXpath ($ buttonXpath , $ html ));
220
+ }
207
221
}
You can’t perform that action at this time.
0 commit comments