payment-request/payment-response/helpers.js
/**
 * Runs a manual test for payment
 *
 * @param {HTMLButtonElement} button The HTML button.
 * @param {PaymentOptions?} options.
 * @param {Object} expected What property values are expected to pass the test.
 * @param {String?} id And id for the request/response pair.
 */
Runs a manual test for payment
@param {HTMLButtonElement} button The HTML button.
Runs a manual test for payment @param { HTMLButtonElement } button The HTML button .
async function runManualTest(button, options, expected = {}, id = undefined) {
  button.disabled = true;
  const { request, response } = await getPaymentRequestResponse(options, id);
  await response.complete();
  test(() => {
    assert_equals(response.requestId, request.id, `Expected ids to match`);
    for (const [attribute, value] of Object.entries(expected)) {
      assert_equals(
        response[attribute],
        value,
        `Expected response ${attribute} attribute to be ${value}`
      );
    }
  }, button.textContent.trim());
}
async function runManualTest ( button , options , expected = { } , id = undefined ) { button . disabled = true ; const { request , response } = await getPaymentRequestResponse ( options , id ) ; await response . complete ( ) ; test ( ( ) => { assert_equals ( response . requestId , request . id , ` ` ) ; for ( const [ attribute , value ] of Object . entries ( expected ) ) { assert_equals ( response [ attribute ] , value , ` ${ attribute } ${ value } ` ) ; } } , button . textContent . trim ( ) ) ; }
Runs a manual test for payment
 @param {HTMLButtonElement} button The HTML button.
Runs a manual test for payment @param { HTMLButtonElement } button The HTML button .