Skip to content

Commit 6297199

Browse files
author
Vitaliy Boyko
committed
GraphQl-890: added shipping addresses to tests
1 parent 863d178 commit 6297199

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function testAddSimpleProductToCart()
5050
$response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());
5151

5252
self::assertArrayHasKey('cart', $response['addSimpleProductsToCart']);
53+
self::assertArrayHasKey('shipping_addresses', $response['addSimpleProductsToCart']['cart']);
54+
self::assertEmpty($response['addSimpleProductsToCart']['cart']['shipping_addresses']);
5355
self::assertEquals($quantity, $response['addSimpleProductsToCart']['cart']['items'][0]['quantity']);
5456
self::assertEquals($sku, $response['addSimpleProductsToCart']['cart']['items'][0]['product']['sku']);
5557
self::assertArrayHasKey('prices', $response['addSimpleProductsToCart']['cart']['items'][0]);
@@ -303,6 +305,20 @@ private function getQuery(string $maskedQuoteId, string $sku, float $quantity):
303305
}
304306
}
305307
}
308+
shipping_addresses {
309+
firstname
310+
lastname
311+
company
312+
street
313+
city
314+
postcode
315+
telephone
316+
country {
317+
code
318+
label
319+
}
320+
__typename
321+
}
306322
}
307323
}
308324
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public function testAddSimpleProductToCart()
4545
$response = $this->graphQlMutation($query);
4646
self::assertArrayHasKey('cart', $response['addSimpleProductsToCart']);
4747

48+
self::assertArrayHasKey('shipping_addresses', $response['addSimpleProductsToCart']['cart']);
49+
self::assertEmpty($response['addSimpleProductsToCart']['cart']['shipping_addresses']);
4850
self::assertEquals($quantity, $response['addSimpleProductsToCart']['cart']['items'][0]['quantity']);
4951
self::assertEquals($sku, $response['addSimpleProductsToCart']['cart']['items'][0]['product']['sku']);
5052
self::assertArrayHasKey('prices', $response['addSimpleProductsToCart']['cart']['items'][0]);
@@ -272,6 +274,20 @@ private function getQuery(string $maskedQuoteId, string $sku, float $quantity):
272274
}
273275
}
274276
}
277+
shipping_addresses {
278+
firstname
279+
lastname
280+
company
281+
street
282+
city
283+
postcode
284+
telephone
285+
country {
286+
code
287+
label
288+
}
289+
__typename
290+
}
275291
}
276292
}
277293
}

0 commit comments

Comments
 (0)