From bc519ce1e883d03a339211eca6b254038848b777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikha=C3=ABl=20Bois?= Date: Sat, 29 Jan 2022 02:32:09 -0500 Subject: [PATCH] [PWA-2549] Magento\GraphQl\Catalog\ProductSearchTest test fails (#22) * PWA-2549 WIP skip api tests * PWA-2549 Remove sort plugin * PWA-2549 Update deps --- CatalogGraphQlAux/Plugin/Aggregations.php | 51 -------- .../Test/Unit/Plugin/AggregationsTest.php | 112 ------------------ CatalogGraphQlAux/etc/graphql/di.xml | 3 - QuoteGraphQlPwa/composer.json | 2 +- ReCaptchaPwa/composer.json | 2 +- ReCaptchaPwa/etc/module.xml | 1 + 6 files changed, 3 insertions(+), 168 deletions(-) delete mode 100644 CatalogGraphQlAux/Plugin/Aggregations.php delete mode 100644 CatalogGraphQlAux/Test/Unit/Plugin/AggregationsTest.php diff --git a/CatalogGraphQlAux/Plugin/Aggregations.php b/CatalogGraphQlAux/Plugin/Aggregations.php deleted file mode 100644 index eac6868..0000000 --- a/CatalogGraphQlAux/Plugin/Aggregations.php +++ /dev/null @@ -1,51 +0,0 @@ - $b['position']; - }); - } - - return $result; - } -} diff --git a/CatalogGraphQlAux/Test/Unit/Plugin/AggregationsTest.php b/CatalogGraphQlAux/Test/Unit/Plugin/AggregationsTest.php deleted file mode 100644 index 16e12eb..0000000 --- a/CatalogGraphQlAux/Test/Unit/Plugin/AggregationsTest.php +++ /dev/null @@ -1,112 +0,0 @@ -eavConfigMock = $this->createMock(Config::class); - - $this->model = new AggregationsPlugin(); - } - - public function testAfterResolveWithoutAttributes() - { - $aggregationsMock = $this->createMock(Aggregations::class); - - $this->assertEquals( - null, - $this->model->afterResolve($aggregationsMock, null) - ); - } - - public function testAfterResolveWithAttributes() - { - $resultMock = [ - [ - 'attribute_code' => 'attribute_c', - 'position' => 20, - 'label' => 'C' - ], - [ - 'attribute_code' => 'attribute_b', - 'position' => 10, - 'label' => 'B' - ], - [ - 'attribute_code' => 'attribute_d', - 'position' => 5, - 'label' => 'D' - ], - [ - 'attribute_code' => 'attribute_a', - 'position' => 10, - 'label' => 'A' - ], - [ - 'attribute_code' => self::CATEGORY_CODE, - 'label' => 'Category' - ] - ]; - - $aggregationsMock = $this->createMock(Aggregations::class); - $expectedResult = [ - [ - 'attribute_code' => self::CATEGORY_CODE, - 'label' => 'Category' - ], - [ - 'attribute_code' => 'attribute_d', - 'position' => 5, - 'label' => 'D' - ], - [ - 'attribute_code' => 'attribute_a', - 'position' => 10, - 'label' => 'A' - ], - [ - 'attribute_code' => 'attribute_b', - 'position' => 10, - 'label' => 'B' - ], - [ - 'attribute_code' => 'attribute_c', - 'position' => 20, - 'label' => 'C' - ] - ]; - - $this->assertEquals( - $expectedResult, - $this->model->afterResolve($aggregationsMock, $resultMock) - ); - } -} diff --git a/CatalogGraphQlAux/etc/graphql/di.xml b/CatalogGraphQlAux/etc/graphql/di.xml index 8ab2378..79aa5d3 100644 --- a/CatalogGraphQlAux/etc/graphql/di.xml +++ b/CatalogGraphQlAux/etc/graphql/di.xml @@ -13,9 +13,6 @@ - - - diff --git a/QuoteGraphQlPwa/composer.json b/QuoteGraphQlPwa/composer.json index 0324936..8501343 100644 --- a/QuoteGraphQlPwa/composer.json +++ b/QuoteGraphQlPwa/composer.json @@ -12,6 +12,7 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", + "magento/module-quote": "*", "magento/module-quote-graph-ql": "*" }, "suggest": { @@ -26,4 +27,3 @@ } } } - diff --git a/ReCaptchaPwa/composer.json b/ReCaptchaPwa/composer.json index d60fa07..62fd369 100644 --- a/ReCaptchaPwa/composer.json +++ b/ReCaptchaPwa/composer.json @@ -11,6 +11,7 @@ }, "require": { "php": "~7.3.0||~7.4.0", + "magento/module-config": "*", "magento/framework": "*" }, "suggest": { @@ -25,4 +26,3 @@ } } } - diff --git a/ReCaptchaPwa/etc/module.xml b/ReCaptchaPwa/etc/module.xml index 944bdd0..f7f8101 100644 --- a/ReCaptchaPwa/etc/module.xml +++ b/ReCaptchaPwa/etc/module.xml @@ -9,6 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> +