| Index: components/payments/content/payment_response_helper_unittest.cc
|
| diff --git a/components/payments/content/payment_response_helper_unittest.cc b/components/payments/content/payment_response_helper_unittest.cc
|
| index d072121cf21dbc64b14569f45419cea02875cb42..3b56de9925586855b0cc914c8254b70b2c3b2557 100644
|
| --- a/components/payments/content/payment_response_helper_unittest.cc
|
| +++ b/components/payments/content/payment_response_helper_unittest.cc
|
| @@ -245,7 +245,7 @@ TEST_F(PaymentResponseHelperTest, GeneratePaymentResponse_ContactDetails_All) {
|
|
|
| // Check that all the expected values were set.
|
| EXPECT_EQ("John H. Doe", response()->payer_name.value());
|
| - EXPECT_EQ("16502111111", response()->payer_phone.value());
|
| + EXPECT_EQ("+16502111111", response()->payer_phone.value());
|
| EXPECT_EQ("johndoe@hades.com", response()->payer_email.value());
|
| }
|
|
|
| @@ -266,4 +266,22 @@ TEST_F(PaymentResponseHelperTest, GeneratePaymentResponse_ContactDetails_Some) {
|
| EXPECT_FALSE(response()->payer_email.has_value());
|
| }
|
|
|
| +// Tests the the generated PaymentResponse has the correct values for the
|
| +// contact details when all values are requested.
|
| +TEST_F(PaymentResponseHelperTest,
|
| + GeneratePaymentResponse_ContactPhoneIsFormatted) {
|
| + // Request one contact detail value.
|
| + mojom::PaymentOptionsPtr options = mojom::PaymentOptions::New();
|
| + options->request_payer_phone = true;
|
| + test_address()->SetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER,
|
| + base::UTF8ToUTF16("(515) 123-1234"));
|
| + RecreateSpecWithOptions(std::move(options));
|
| +
|
| + PaymentResponseHelper helper("en-US", spec(), test_instrument(),
|
| + test_address(), test_address(), this);
|
| +
|
| + // Check that the phone was formatted.
|
| + EXPECT_EQ("+15151231234", response()->payer_phone.value());
|
| +}
|
| +
|
| } // namespace payments
|
|
|