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([
238238
239239 // Add defaultvalue attribute to state/province select element
240240 regionList . attr ( 'defaultvalue' , this . options . defaultRegion ) ;
241+ this . options . form . find ( '[type="submit"]' ) . removeAttr ( 'disabled' ) . show ( ) ;
241242 } ,
242243
243244 /**
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ $viewModel = $block->getViewModel();
202202 <button type="submit"
203203 class="action save primary"
204204 data-action="save-address"
205+ disabled="disabled"
205206 title="<?= $ escaper ->escapeHtmlAttr (__ ('Save Address ' )) ?> ">
206207 <span><?= $ escaper ->escapeHtml (__ ('Save Address ' )) ?> </span>
207208 </button>
Original file line number Diff line number Diff line change @@ -204,4 +204,18 @@ public function testCheckPostCodeLabels(): void
204204 )
205205 );
206206 }
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+ }
207221}
You can’t perform that action at this time.
0 commit comments