@@ -461,6 +461,55 @@ public function testSetNewShippingAddressWithMissedRequiredParameters(string $in
461
461
$ this ->graphQlMutation ($ query , [], '' , $ this ->getHeaderMap ());
462
462
}
463
463
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
+
464
513
/**
465
514
* @return array
466
515
*/
@@ -474,12 +523,12 @@ public function dataProviderUpdateWithMissedRequiredParameters(): array
474
523
],
475
524
'missed_city ' => [
476
525
'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 ' ,
478
527
],
479
528
'missed_cart_id ' => [
480
529
'shipping_addresses: {} ' ,
481
- 'Required parameter "cart_id" is missing '
482
- ]
530
+ 'Required parameter "cart_id" is missing ' ,
531
+ ],
483
532
];
484
533
}
485
534
0 commit comments