Skip to content

Commit f889827

Browse files
committed
MAGETWO-61226: [FT] CreateProductAttributeEntityTest fails on 2.0.11 since JS validation error is not displayed
1 parent 22c402d commit f889827

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ define([
5555

5656
if (render) {
5757
this.render();
58+
this.updateItemsCountField();
5859
}
5960
},
6061
remove: function (event) {

dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,16 @@ public function processAssert(
5858
$productForm = $catalogProductEdit->getProductForm();
5959
$productForm->fill($simpleProduct);
6060
$catalogProductEdit->getFormPageActions()->save();
61-
$failedAttributes = $productForm->getRequireNoticeAttributes($simpleProduct);
61+
$actualErrorMessage = $catalogProductEdit->getMessagesBlock()->getErrorMessage();
6262
$attributeLabel = $attribute->getFrontendLabel();
63-
$actualMessage = $this->getActualMessage($failedAttributes, $attributeLabel);
6463

6564
\PHPUnit_Framework_Assert::assertEquals(
6665
sprintf(self::UNIQUE_MESSAGE, $attributeLabel),
67-
$actualMessage,
66+
$actualErrorMessage,
6867
'JS error notice on product edit page is not equal to expected.'
6968
);
7069
}
7170

72-
/**
73-
* Get actual message.
74-
*
75-
* @param array $errors
76-
* @param string $attributeLabel
77-
* @return mixed
78-
*/
79-
protected function getActualMessage(array $errors, $attributeLabel)
80-
{
81-
return isset($errors['product-details'][$attributeLabel])
82-
? $errors['product-details'][$attributeLabel]
83-
: null;
84-
}
85-
8671
/**
8772
* Create simple product fixture.
8873
*
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd">
10+
<rule scope="testsuite">
11+
<allow>
12+
<class value="Magento\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest" />
13+
</allow>
14+
</rule>
15+
</config>

0 commit comments

Comments
 (0)