Skip to content

Commit c6ed475

Browse files
authored
ENGCOM-6212: Extend test testSetNewShippingAddressWithMissedRequiredParameters #1034
2 parents cc67aa0 + 8f47c01 commit c6ed475

File tree

1 file changed

+52
-3
lines changed

1 file changed

+52
-3
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,55 @@ public function testSetNewShippingAddressWithMissedRequiredParameters(string $in
461461
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
462462
}
463463

464+
/**
465+
* Covers case with empty street
466+
*
467+
* @todo Unskip case with missing "street" parameter https://github.com/magento/graphql-ce/issues/1033
468+
*
469+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
470+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
471+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
472+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
473+
*
474+
* @expectedException \Magento\Framework\GraphQl\Exception\GraphQlInputException
475+
* @expectedExceptionMessage Required parameter "street" is missing
476+
*/
477+
public function testSetNewShippingAddressWithMissedRequiredStreetParameters()
478+
{
479+
$this->markTestSkipped(
480+
'Notice: Undefined index: street https://github.com/magento/graphql-ce/issues/1033'
481+
);
482+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
483+
$query = <<<QUERY
484+
mutation {
485+
setShippingAddressesOnCart(
486+
input: {
487+
cart_id: "$maskedQuoteId"
488+
shipping_addresses: [
489+
{
490+
address: {
491+
country_code: "US"
492+
firstname: "J"
493+
lastname: "D"
494+
telephone: "+"
495+
city: "C"
496+
}
497+
}
498+
]
499+
}
500+
) {
501+
cart {
502+
shipping_addresses {
503+
city
504+
}
505+
}
506+
}
507+
}
508+
QUERY;
509+
510+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
511+
}
512+
464513
/**
465514
* @return array
466515
*/
@@ -474,12 +523,12 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array
474523
],
475524
'missed_city' => [
476525
'shipping_addresses: [ { address: { save_in_address_book: false } } ]',
477-
'Field CartAddressInput.city of required type String! was not provided'
526+
'Field CartAddressInput.city of required type String! was not provided',
478527
],
479528
'missed_cart_id' => [
480529
'shipping_addresses: {}',
481-
'Required parameter "cart_id" is missing'
482-
]
530+
'Required parameter "cart_id" is missing',
531+
],
483532
];
484533
}
485534

0 commit comments

Comments
 (0)