Skip to content

Commit d6aeca9

Browse files
author
Prabhu Ram
committed
MC-38443: [GraphQl] media_gallery has redundant entries in configurable_options_selection_metadata
- Fixed tests
1 parent ea24381 commit d6aeca9

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionMetadataTest.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function testWithoutSelectedOption()
6363
html
6464
}
6565
... on ConfigurableProduct {
66-
configurable_options_selection_metadata(
67-
selectedConfigurableOptionValues: []
66+
configurable_product_options_selection(
67+
configurableOptionValueUids: []
6868
) {
6969
options_available_for_selection {
7070
option_value_uids
@@ -78,11 +78,11 @@ public function testWithoutSelectedOption()
7878
QUERY;
7979
$response = $this->graphQlQuery($query);
8080
$this->assertEquals(1, count($response['products']['items']));
81-
$this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata']
81+
$this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection']
8282
['options_available_for_selection']));
83-
$this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata']
83+
$this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection']
8484
['options_available_for_selection'][0]['option_value_uids']));
85-
$this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata']
85+
$this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection']
8686
['options_available_for_selection'][1]['option_value_uids']));
8787
}
8888

@@ -112,8 +112,8 @@ public function testSelectedFirstAttributeFirstOption()
112112
html
113113
}
114114
... on ConfigurableProduct {
115-
configurable_options_selection_metadata(
116-
selectedConfigurableOptionValues: ["{$firstOptionUid}"]
115+
configurable_product_options_selection(
116+
configurableOptionValueUids: ["{$firstOptionUid}"]
117117
) {
118118
options_available_for_selection {
119119
option_value_uids
@@ -128,20 +128,20 @@ public function testSelectedFirstAttributeFirstOption()
128128

129129
$response = $this->graphQlQuery($query);
130130
$this->assertEquals(1, count($response['products']['items']));
131-
$this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata']
131+
$this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection']
132132
['options_available_for_selection']));
133-
$this->assertEquals(1, count($response['products']['items'][0]['configurable_options_selection_metadata']
133+
$this->assertEquals(1, count($response['products']['items'][0]['configurable_product_options_selection']
134134
['options_available_for_selection'][0]['option_value_uids']));
135135
$this->assertEquals($firstOptionUid, $response['products']['items'][0]
136-
['configurable_options_selection_metadata']['options_available_for_selection'][0]['option_value_uids'][0]);
137-
$this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata']
136+
['configurable_product_options_selection']['options_available_for_selection'][0]['option_value_uids'][0]);
137+
$this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection']
138138
['options_available_for_selection'][1]['option_value_uids']));
139139

140140
$secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions();
141141
$this->assertAvailableOptionUids(
142142
$this->getSecondConfigurableAttribute()->getAttributeId(),
143143
$secondAttributeOptions,
144-
$response['products']['items'][0]['configurable_options_selection_metadata']
144+
$response['products']['items'][0]['configurable_product_options_selection']
145145
['options_available_for_selection'][1]['option_value_uids']
146146
);
147147
}
@@ -172,8 +172,8 @@ public function testSelectedFirstAttributeLastOption()
172172
html
173173
}
174174
... on ConfigurableProduct {
175-
configurable_options_selection_metadata(
176-
selectedConfigurableOptionValues: ["{$lastOptionUid}"]
175+
configurable_product_options_selection(
176+
configurableOptionValueUids: ["{$lastOptionUid}"]
177177
) {
178178
options_available_for_selection {
179179
option_value_uids
@@ -188,13 +188,13 @@ public function testSelectedFirstAttributeLastOption()
188188

189189
$response = $this->graphQlQuery($query);
190190
$this->assertEquals(1, count($response['products']['items']));
191-
$this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata']
191+
$this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection']
192192
['options_available_for_selection']));
193-
$this->assertEquals(1, count($response['products']['items'][0]['configurable_options_selection_metadata']
193+
$this->assertEquals(1, count($response['products']['items'][0]['configurable_product_options_selection']
194194
['options_available_for_selection'][0]['option_value_uids']));
195-
$this->assertEquals($lastOptionUid, $response['products']['items'][0]['configurable_options_selection_metadata']
195+
$this->assertEquals($lastOptionUid, $response['products']['items'][0]['configurable_product_options_selection']
196196
['options_available_for_selection'][0]['option_value_uids'][0]);
197-
$this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata']
197+
$this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection']
198198
['options_available_for_selection'][1]['option_value_uids']));
199199
$secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions();
200200
unset($secondAttributeOptions[0]);
@@ -203,7 +203,7 @@ public function testSelectedFirstAttributeLastOption()
203203
$this->assertAvailableOptionUids(
204204
$this->getSecondConfigurableAttribute()->getAttributeId(),
205205
$secondAttributeOptions,
206-
$response['products']['items'][0]['configurable_options_selection_metadata']
206+
$response['products']['items'][0]['configurable_product_options_selection']
207207
['options_available_for_selection'][1]['option_value_uids']
208208
);
209209
}
@@ -240,8 +240,8 @@ public function testSelectedVariant()
240240
html
241241
}
242242
... on ConfigurableProduct {
243-
configurable_options_selection_metadata(
244-
selectedConfigurableOptionValues: ["{$firstAttributeFirstOptionUid}", "{$secondAttributeFirstOptionUid}"]
243+
configurable_product_options_selection(
244+
configurableOptionValueUids: ["{$firstAttributeFirstOptionUid}", "{$secondAttributeFirstOptionUid}"]
245245
) {
246246
options_available_for_selection {
247247
option_value_uids
@@ -259,11 +259,11 @@ public function testSelectedVariant()
259259
QUERY;
260260
$response = $this->graphQlQuery($query);
261261
$this->assertEquals(1, count($response['products']['items']));
262-
$this->assertNotNull($response['products']['items'][0]['configurable_options_selection_metadata']
262+
$this->assertNotNull($response['products']['items'][0]['configurable_product_options_selection']
263263
['variant']);
264264
$this->assertEquals(
265265
'simple_' . $firstOptions[1]->getValue() . '_' . $secondOptions[1]->getValue(),
266-
$response['products']['items'][0]['configurable_options_selection_metadata']
266+
$response['products']['items'][0]['configurable_product_options_selection']
267267
['variant']['sku']
268268
);
269269
}
@@ -288,8 +288,8 @@ public function testMediaGalleryForAll()
288288
html
289289
}
290290
... on ConfigurableProduct {
291-
configurable_options_selection_metadata(
292-
selectedConfigurableOptionValues: []
291+
configurable_product_options_selection(
292+
configurableOptionValueUids: []
293293
) {
294294
options_available_for_selection {
295295
option_value_uids
@@ -306,7 +306,7 @@ public function testMediaGalleryForAll()
306306
QUERY;
307307
$response = $this->graphQlQuery($query);
308308
$this->assertEquals(1, count($response['products']['items']));
309-
$this->assertEquals(14, count($response['products']['items'][0]['configurable_options_selection_metadata']
309+
$this->assertEquals(14, count($response['products']['items'][0]['configurable_product_options_selection']
310310
['media_gallery']));
311311
}
312312

@@ -336,8 +336,8 @@ public function testMediaGalleryWithSelection()
336336
html
337337
}
338338
... on ConfigurableProduct {
339-
configurable_options_selection_metadata(
340-
selectedConfigurableOptionValues: ["$lastOptionUid"]
339+
configurable_product_options_selection(
340+
configurableOptionValueUids: ["$lastOptionUid"]
341341
) {
342342
options_available_for_selection {
343343
option_value_uids
@@ -354,7 +354,7 @@ public function testMediaGalleryWithSelection()
354354
QUERY;
355355
$response = $this->graphQlQuery($query);
356356
$this->assertEquals(1, count($response['products']['items']));
357-
$this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata']
357+
$this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection']
358358
['media_gallery']));
359359
}
360360

0 commit comments

Comments
 (0)