From 7eeba38866f1dfd3cf1a1168667697b782454937 Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Wed, 10 Jun 2020 00:33:15 +0300 Subject: [PATCH 1/9] removed unused construct parameters --- .../Model/Import/AdvancedPricing.php | 4 ---- .../Unit/Model/Import/AdvancedPricingTest.php | 17 ----------------- 2 files changed, 21 deletions(-) diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php index 974397226c56c..e0e70251fefb2 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php @@ -176,10 +176,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract * @param \Magento\Framework\Json\Helper\Data $jsonHelper * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData - * @param \Magento\Eav\Model\Config $config * @param \Magento\Framework\App\ResourceConnection $resource * @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper - * @param \Magento\Framework\Stdlib\StringUtils $string * @param ProcessingErrorAggregatorInterface $errorAggregator * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime * @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory @@ -197,10 +195,8 @@ public function __construct( \Magento\Framework\Json\Helper\Data $jsonHelper, \Magento\ImportExport\Helper\Data $importExportData, \Magento\ImportExport\Model\ResourceModel\Import\Data $importData, - \Magento\Eav\Model\Config $config, \Magento\Framework\App\ResourceConnection $resource, \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper, - \Magento\Framework\Stdlib\StringUtils $string, ProcessingErrorAggregatorInterface $errorAggregator, \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory, diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php index e57ed2c91409d..08d75f0f36f07 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php @@ -16,7 +16,6 @@ use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface; use Magento\CatalogImportExport\Model\Import\Product\StoreResolver; use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory; -use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Type; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\AdapterInterface; @@ -26,7 +25,6 @@ use Magento\Framework\Json\Helper\Data; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; -use Magento\Framework\Stdlib\StringUtils; use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; use Magento\ImportExport\Model\ResourceModel\Helper; @@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase */ protected $dataSourceModel; - /** - * @var Config - */ - protected $eavConfig; - /** * @var TimezoneInterface|MockObject */ @@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase */ protected $advancedPricing; - /** - * @var StringUtils - */ - protected $stringObject; - /** * @var ProcessingErrorAggregatorInterface */ @@ -165,10 +153,8 @@ protected function setUp(): void ); $this->resource->method('getConnection')->willReturn($this->connection); $this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class); - $this->eavConfig = $this->createMock(Config::class); $entityType = $this->createMock(Type::class); $entityType->method('getEntityTypeId')->willReturn(''); - $this->eavConfig->method('getEntityType')->willReturn($entityType); $this->resourceFactory = $this->getMockBuilder( \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class ) @@ -193,7 +179,6 @@ protected function setUp(): void $this->tierPriceValidator = $this->createMock( TierPrice::class ); - $this->stringObject = $this->createMock(StringUtils::class); $this->errorAggregator = $this->getErrorAggregatorObject(); $this->dateTime = $this->getMockBuilder(DateTime::class) ->disableOriginalConstructor() @@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = []) $this->jsonHelper, $this->importExportData, $this->dataSourceModel, - $this->eavConfig, $this->resource, $this->resourceHelper, - $this->stringObject, $this->errorAggregator, $this->dateTime, $this->resourceFactory, From e15fc1d9741a566d657e06950e5a3b3fe6a6c579 Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Wed, 10 Jun 2020 11:34:54 +0300 Subject: [PATCH 2/9] fixed static test --- .../Model/Import/AdvancedPricing.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php index e0e70251fefb2..254dbcca852ee 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php @@ -10,7 +10,7 @@ use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; /** - * Class AdvancedPricing + * Import advanced pricing class * * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -19,35 +19,20 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity { const VALUE_ALL_GROUPS = 'ALL GROUPS'; - const VALUE_ALL_WEBSITES = 'All Websites'; - const COL_SKU = 'sku'; - const COL_TIER_PRICE_WEBSITE = 'tier_price_website'; - const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group'; - const COL_TIER_PRICE_QTY = 'tier_price_qty'; - const COL_TIER_PRICE = 'tier_price'; - const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value'; - const COL_TIER_PRICE_TYPE = 'tier_price_value_type'; - const TIER_PRICE_TYPE_FIXED = 'Fixed'; - const TIER_PRICE_TYPE_PERCENT = 'Discount'; - const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price'; - const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0'; - const ENTITY_TYPE_CODE = 'advanced_pricing'; - const VALIDATOR_MAIN = 'validator'; - const VALIDATOR_WEBSITE = 'validator_website'; /** @@ -55,7 +40,6 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract * @see VALIDATOR_TIER_PRICE */ private const VALIDATOR_TEAR_PRICE = 'validator_tier_price'; - private const VALIDATOR_TIER_PRICE = 'validator_tier_price'; /** From f230257dceda451d27031100441c675ee5fa48d5 Mon Sep 17 00:00:00 2001 From: Shankar Konar Date: Mon, 24 Aug 2020 14:58:51 +0530 Subject: [PATCH 3/9] Fixed issue with search button disabled is not respecting minimum search length --- app/code/Magento/Search/view/frontend/web/js/form-mini.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index b4493c5f38089..1781cb9694735 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -294,9 +294,10 @@ define([ dropdown = $('
    '), value = this.element.val(); - this.submitBtn.disabled = isEmpty(value); + this.submitBtn.disabled = true; if (value.length >= parseInt(this.options.minSearchLength, 10)) { + this.submitBtn.disabled = false; $.getJSON(this.options.url, { q: value }, $.proxy(function (data) { From 1973efbde04dbc5b3081755c071cbf9e6d707532 Mon Sep 17 00:00:00 2001 From: Shankar Konar Date: Tue, 25 Aug 2020 14:05:33 +0530 Subject: [PATCH 4/9] MFTF test added and fixed the issue if user press return --- ...erifySearchButtonIsDisabledActionGroup.xml | 24 +++++++++++++++ ...fySearchButtonIsNotDisabledActionGroup.xml | 23 +++++++++++++++ .../StoreFrontFillSearchActionGroup.xml | 19 ++++++++++++ ...ttonDisabledTillMinimumSearchLengthHit.xml | 29 +++++++++++++++++++ ...NotDisabledAfterMinimumSearchLengthHit.xml | 29 +++++++++++++++++++ .../Search/view/frontend/web/js/form-mini.js | 6 ++-- 6 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml create mode 100644 app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml new file mode 100644 index 0000000000000..b7b814713d194 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml @@ -0,0 +1,24 @@ + + + + + + + + Fills in the provided Search Query on the Admin Search Term grid page. + + + + + + $grabSearchButtonDisabledAttribute + true + + + diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml new file mode 100644 index 0000000000000..b22f91a3549ef --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml @@ -0,0 +1,23 @@ + + + + + + + + Fills in the provided Search Query on the Admin Search Term grid page. + + + + + + $grabSearchButtonAttribute + + + diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml new file mode 100644 index 0000000000000..f90297df02c1f --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml new file mode 100644 index 0000000000000..da461c4b8dbb0 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml @@ -0,0 +1,29 @@ + + + + + + + + + <description value="Storefront verify search button is disabled if search term is less than minimum search length"/> + <severity value="CRITICAL"/> + <testCaseId value="https://github.com/magento/magento2/issues/29704"/> + <group value="searchFrontend"/> + </annotations> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <actionGroup ref="StoreFrontFillSearchActionGroup" stepKey="fillSearchByTextLessThanMinimumSearchLength"> + <argument name="query" value="Te"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontVerifySearchButtonIsDisabledActionGroup" stepKey="assertSearchButtonIsDisabled"/> + </test> +</tests> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml new file mode 100644 index 0000000000000..e7e0eb54568e0 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit"> + <annotations> + <stories value="Search Button Not Disabled"/> + <title value="Verify search button is not disabled if search term is equal or greater than minimum search length"/> + <description value="Storefront verify search button is not disabled if search term is equal or greater than minimum search length"/> + <severity value="CRITICAL"/> + <testCaseId value="https://github.com/magento/magento2/issues/29704"/> + <group value="searchFrontend"/> + </annotations> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <actionGroup ref="StoreFrontFillSearchActionGroup" stepKey="fillSearchByTextMoreThanMinimumSearchLength"> + <argument name="query" value="Magento"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup" stepKey="assertSearchButtonIsNotDisabled"/> + </test> +</tests> diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index 1781cb9694735..9b4c814f73d73 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -232,8 +232,10 @@ define([ break; case $.ui.keyCode.ENTER: - this.searchForm.trigger('submit'); - e.preventDefault(); + if (this.element.val().length >= parseInt(this.options.minSearchLength, 10)) { + this.searchForm.trigger('submit'); + e.preventDefault(); + } break; case $.ui.keyCode.DOWN: From 50b83bef10fa63a85ca8f82271f22d7887f57395 Mon Sep 17 00:00:00 2001 From: Shankar Konar <konar.shankar2013@gmail.com> Date: Tue, 25 Aug 2020 17:08:52 +0530 Subject: [PATCH 5/9] Feedback changes --- ...ssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml | 2 +- ...ssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml} | 4 ++-- ...ifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml} | 2 +- ...ifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml} | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename app/code/Magento/Search/Test/Mftf/ActionGroup/{AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml => AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml} (79%) rename app/code/Magento/Search/Test/Mftf/Test/{StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml => StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml} (98%) rename app/code/Magento/Search/Test/Mftf/Test/{StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml => StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml} (84%) diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml index b7b814713d194..57d39e35d539e 100644 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml @@ -11,7 +11,7 @@ <!-- Filter by search query and select --> <actionGroup name="AssertStorefrontVerifySearchButtonIsDisabledActionGroup"> <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + <description>Verify search button has disabled attribute</description> </annotations> <grabAttributeFrom selector="{{StorefrontQuickSearchSection.searchButton}}" userInput="disabled" stepKey="grabSearchButtonDisabledAttribute"/> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml similarity index 79% rename from app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml rename to app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml index b22f91a3549ef..2e1f8d4b68d36 100644 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup.xml +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml @@ -9,9 +9,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- Filter by search query and select --> - <actionGroup name="AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup"> + <actionGroup name="AssertStorefrontVerifySearchButtonIsEnabledActionGroup"> <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + <description>Verify search button does not disabled attribute</description> </annotations> <grabAttributeFrom selector="{{StorefrontQuickSearchSection.searchButton}}" userInput="disabled" stepKey="grabSearchButtonAttribute"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml similarity index 98% rename from app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml rename to app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml index da461c4b8dbb0..10b086609391f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHit"> + <test name="StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest"> <annotations> <stories value="Search Term Disabled"/> <title value="Verify search button is disabled if search term is less than minimum search length"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml similarity index 84% rename from app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml rename to app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml index e7e0eb54568e0..79a192798db3e 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontVerifySearchButtonNotDisabledAfterMinimumSearchLengthHit"> + <test name="StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest"> <annotations> <stories value="Search Button Not Disabled"/> <title value="Verify search button is not disabled if search term is equal or greater than minimum search length"/> @@ -24,6 +24,6 @@ <argument name="query" value="Magento"/> </actionGroup> - <actionGroup ref="AssertStorefrontVerifySearchButtonIsNotDisabledActionGroup" stepKey="assertSearchButtonIsNotDisabled"/> + <actionGroup ref="AssertStorefrontVerifySearchButtonIsEnabledActionGroup" stepKey="assertSearchButtonIsNotDisabled"/> </test> </tests> From 93407393fa39d6d9454257e34c80bf601a0de60c Mon Sep 17 00:00:00 2001 From: joweecaquicla <joie@abovethefray.io> Date: Fri, 4 Sep 2020 02:38:33 +0800 Subject: [PATCH 6/9] magento/adobe-stock-integration#1798: Move Add Selected button to be the last in Old Media Gallery - moved add selected button --- app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php index 9efd24e5003ca..d1c6b0fe7956d 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php @@ -102,7 +102,7 @@ protected function _construct() 'type' => 'button' ], 0, - 0, + 100, 'header' ); } From 268277ee79b3f8ed5a10a9645671d416342c3dfe Mon Sep 17 00:00:00 2001 From: engcom-Echo <engcom-vendorworker-echo@adobe.com> Date: Fri, 4 Sep 2020 16:52:44 +0300 Subject: [PATCH 7/9] change TestCaseId --- ...rifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml | 4 ++-- ...rifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml index 10b086609391f..742807d2c24e2 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml @@ -13,8 +13,8 @@ <stories value="Search Term Disabled"/> <title value="Verify search button is disabled if search term is less than minimum search length"/> <description value="Storefront verify search button is disabled if search term is less than minimum search length"/> - <severity value="CRITICAL"/> - <testCaseId value="https://github.com/magento/magento2/issues/29704"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-37380"/> <group value="searchFrontend"/> </annotations> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml index 79a192798db3e..172fae919623c 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml @@ -13,8 +13,8 @@ <stories value="Search Button Not Disabled"/> <title value="Verify search button is not disabled if search term is equal or greater than minimum search length"/> <description value="Storefront verify search button is not disabled if search term is equal or greater than minimum search length"/> - <severity value="CRITICAL"/> - <testCaseId value="https://github.com/magento/magento2/issues/29704"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-37381"/> <group value="searchFrontend"/> </annotations> From 76be389da9608ce7cf5bfa4f8e618d05e5b82a4d Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Sun, 6 Sep 2020 19:15:58 +0100 Subject: [PATCH 8/9] magento/adobe-stock-integration#1810: Fixed saving asset keywords links for db prefix --- .../Model/ResourceModel/Keyword/SaveAssetLinks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/MediaGallery/Model/ResourceModel/Keyword/SaveAssetLinks.php b/app/code/Magento/MediaGallery/Model/ResourceModel/Keyword/SaveAssetLinks.php index eb6bd2aad236c..87f9359d4fc37 100644 --- a/app/code/Magento/MediaGallery/Model/ResourceModel/Keyword/SaveAssetLinks.php +++ b/app/code/Magento/MediaGallery/Model/ResourceModel/Keyword/SaveAssetLinks.php @@ -133,7 +133,7 @@ private function deleteAssetKeywords(int $assetId, array $obsoleteKeywordIds): v /** @var Mysql $connection */ $connection = $this->resourceConnection->getConnection(); $connection->delete( - $connection->getTableName( + $this->resourceConnection->getTableName( self::TABLE_ASSET_KEYWORD ), [ @@ -196,7 +196,7 @@ private function setAssetUpdatedAt(int $assetId): void try { $connection = $this->resourceConnection->getConnection(); $connection->update( - $connection->getTableName(self::TABLE_MEDIA_ASSET), + $this->resourceConnection->getTableName(self::TABLE_MEDIA_ASSET), ['updated_at' => null], ['id =?' => $assetId] ); From 4ffadc9f30ffcf3a52ea5a057294e9e1ed7cc6c9 Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Mon, 7 Sep 2020 11:32:31 +0100 Subject: [PATCH 9/9] magento/magento2#29921: Fixed unit tests --- .../Model/ResourceModel/Keyword/SaveAssetLinksTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/Keyword/SaveAssetLinksTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/Keyword/SaveAssetLinksTest.php index d027f0ed21b53..6531cddf628df 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/Keyword/SaveAssetLinksTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/Keyword/SaveAssetLinksTest.php @@ -78,10 +78,14 @@ public function testAssetKeywordsSave(int $assetId, array $keywordIds, array $va $this->resourceConnectionMock->expects($this->exactly(2)) ->method('getConnection') ->willReturn($this->connectionMock); - $this->resourceConnectionMock->expects($this->once()) + $this->resourceConnectionMock->expects($this->any()) ->method('getTableName') - ->with('media_gallery_asset_keyword') - ->willReturn('prefix_media_gallery_asset_keyword'); + ->willReturnMap( + [ + ['media_gallery_asset_keyword', 'default', 'prefix_media_gallery_asset_keyword'], + ['media_gallery_asset', 'default', 'prefix_media_gallery_asset'] + ] + ); $this->connectionMock->expects($this->once()) ->method('insertArray') ->with(