Skip to content

Commit 9594805

Browse files
author
Prabhu Ram
committed
MC-37603: [Graphql]Item belonging to one customer's wishlist can be updated and added to a different customer's wishlist
- Fixed review comments
1 parent f06f098 commit 9594805

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/DeleteProductsFromWishlistTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public function testUnauthorizedWishlistItemDelete()
6767
$wishlistItem = $wishlist['customer']['wishlist']['items'][0];
6868
$wishlist2 = $this->getWishlist('customer_two@example.com');
6969
$wishlist2Id = $wishlist2['customer']['wishlist']['id'];
70-
$wishlistItem2 = $wishlist['customer']['wishlist']['items'][0];
7170
$query = $this->getQuery((int) $wishlist2Id, (int) $wishlistItem['id']);
7271
$response = $this->graphQlMutation(
7372
$query,
@@ -79,7 +78,7 @@ public function testUnauthorizedWishlistItemDelete()
7978
self::assertNotEmpty($response['removeProductsFromWishlist']['wishlist']['items'], 'empty wish list items');
8079
self::assertCount(1, $response['removeProductsFromWishlist']['wishlist']['items']);
8180
self::assertEquals(
82-
'The wishlist item with ID "'.$wishlistItem2['id'].'" does not belong to the wishlist',
81+
'The wishlist item with ID "'.$wishlistItem['id'].'" does not belong to the wishlist',
8382
$response['removeProductsFromWishlist']['user_errors'][0]['message']
8483
);
8584
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ public function testUpdateSimpleProductFromWishlist(): void
6767
public function testUnauthorizedWishlistItemUpdate()
6868
{
6969
$wishlist = $this->getWishlist();
70-
$wishlistId = $wishlist['customer']['wishlist']['id'];
7170
$wishlistItem = $wishlist['customer']['wishlist']['items'][0];
7271
$wishlist2 = $this->getWishlist('customer_two@example.com');
7372
$wishlist2Id = $wishlist2['customer']['wishlist']['id'];
74-
$wishlistItem2 = $wishlist['customer']['wishlist']['items'][0];
7573
$qty = 2;
7674
$updateWishlistQuery = $this->getQueryWithNoDescription((int) $wishlist2Id, (int) $wishlistItem['id'], $qty);
7775
$response = $this->graphQlMutation(
@@ -84,7 +82,7 @@ public function testUnauthorizedWishlistItemUpdate()
8482
self::assertNotEmpty($response['updateProductsInWishlist']['wishlist']['items'], 'empty wish list items');
8583
self::assertCount(1, $response['updateProductsInWishlist']['wishlist']['items']);
8684
self::assertEquals(
87-
'The wishlist item with ID "'.$wishlistItem2['id'].'" does not belong to the wishlist',
85+
'The wishlist item with ID "'.$wishlistItem['id'].'" does not belong to the wishlist',
8886
$response['updateProductsInWishlist']['user_errors'][0]['message']
8987
);
9088
}

0 commit comments

Comments
 (0)