Bug 1469464 - Always hide View All, remove summary heading, add 'Pay to'. r=sfoster draft
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Wed, 11 Jul 2018 23:16:12 -0700
changeset 817201 2f958be4842ff19804a034764bb22b7ae5743005
parent 815844 5a0ddea9ad624286eb863e8419e144d5cbae4d58
child 817202 fa9cf2891af0b01e26771117573efffa7f0c9688
push id115981
push usermozilla@noorenberghe.ca
push dateThu, 12 Jul 2018 06:45:37 +0000
reviewerssfoster
bugs1469464
milestone63.0a1
Bug 1469464 - Always hide View All, remove summary heading, add 'Pay to'. r=sfoster MozReview-Commit-ID: 5XQNH97o65T
browser/components/payments/res/paymentRequest.xhtml
browser/components/payments/test/mochitest/test_payment_dialog.html
--- a/browser/components/payments/res/paymentRequest.xhtml
+++ b/browser/components/payments/res/paymentRequest.xhtml
@@ -5,16 +5,18 @@
 <!DOCTYPE html [
   <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
   %globalDTD;
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
   %brandDTD;
 
   <!ENTITY viewAllItems               "View All Items">
   <!ENTITY paymentSummaryTitle        "Your Payment">
+  <!ENTITY header.payTo               "Pay to">
+
   <!ENTITY shippingAddressLabel       "Shipping Address">
   <!ENTITY deliveryAddressLabel       "Delivery Address">
   <!ENTITY pickupAddressLabel         "Pickup Address">
   <!ENTITY shippingOptionsLabel       "Shipping Options">
   <!ENTITY paymentMethodsLabel        "Payment Method">
   <!ENTITY address.addLink.label      "Add">
   <!ENTITY address.editLink.label     "Edit">
   <!ENTITY basicCard.addLink.label    "Add">
@@ -78,27 +80,25 @@
   <script type="module" src="containers/payment-dialog.js"></script>
   <script type="module" src="paymentRequest.js"></script>
 
   <template id="payment-dialog-template">
     <header>
       <div id="total">
         <h2 class="label"></h2>
         <currency-amount></currency-amount>
-        <div id="host-name"></div>
+        <div>&header.payTo; <span id="host-name"></span></div>
       </div>
-      <div id="top-buttons" >
+      <div id="top-buttons" hidden="hidden">
         <button id="view-all" class="closed">&viewAllItems;</button>
       </div>
     </header>
 
     <div id="main-container">
       <section id="payment-summary" class="page">
-        <h2>&paymentSummaryTitle;</h2>
-
         <section>
           <div id="error-text"></div>
 
           <div class="shipping-related"
                id="shipping-type-label"
                data-shipping-address-label="&shippingAddressLabel;"
                data-delivery-address-label="&deliveryAddressLabel;"
                data-persist-checkbox-label="&addressPage.persistCheckbox.label;"
--- a/browser/components/payments/test/mochitest/test_payment_dialog.html
+++ b/browser/components/payments/test/mochitest/test_payment_dialog.html
@@ -3,16 +3,17 @@
 <!--
 Test the payment-dialog custom element
 -->
 <head>
   <meta charset="utf-8">
   <title>Test the payment-dialog element</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/AddTask.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
   <script src="sinon-2.3.2.js"></script>
   <script src="payments_common.js"></script>
   <script src="../../res/vendor/custom-elements.min.js"></script>
   <script src="../../res/unprivileged-fallbacks.js"></script>
 
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <link rel="stylesheet" type="text/css" href="../../res/paymentRequest.css"/>
 </head>
@@ -88,16 +89,17 @@ add_task(async function test_initialStat
   is(initialState.page.id, "payment-summary", "Check initial page");
 });
 
 add_task(async function test_viewAllButtonVisibility() {
   await setup();
 
   let button = el1._viewAllButton;
   ok(button.hidden, "Button is initially hidden when there are no items to show");
+  ok(isHidden(button), "Button should be visibly hidden since bug 1469464")
 
   // Add a display item.
   let request = deepClone(el1.requestStore.getState().request);
   request.paymentDetails.displayItems = [
     {
       "label": "Triangle",
       "amount": {
         "currency": "CAD",