Skip to content

Commit f6c4efd

Browse files
committed
JS and UNIT testing
1 parent 9a73e4c commit f6c4efd

File tree

2 files changed

+10
-3
lines changed
  • app/code/Magento/Catalog/view/adminhtml/web/js
  • dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Category

2 files changed

+10
-3
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/category-tree.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ define([
1515
element,
1616
x;
1717

18-
decodeEntities = (function () {
18+
// noinspection JSUnusedAssignment
19+
decodeEntities = function () {
1920
//create a new html document (doesn't execute script tags in child elements)
2021

2122
doc = document.implementation.createHTMLDocument('');
@@ -25,6 +26,7 @@ define([
2526
* Get Text Content
2627
* @param {*} str
2728
* @return {*}
29+
* @public
2830
*/
2931
function getText(str) {
3032
element.innerHTML = str;
@@ -38,6 +40,7 @@ define([
3840
* Get HTML decoded Entities
3941
* @param {*} str
4042
* @return {*}
43+
* @public
4144
*/
4245
function decodeHTMLEntities(str) {
4346
if (str && typeof str === 'string') {
@@ -53,7 +56,7 @@ define([
5356
}
5457

5558
return decodeHTMLEntities;
56-
})();
59+
}(decodeEntities || {});
5760

5861
$.widget('mage.categoryTree', {
5962
options: {

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Category/TreeTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\UrlRewrite\Block\Catalog\Category;
78

89
/**
@@ -56,7 +57,10 @@ public function testGetTreeArrayApostropheReplaced()
5657
$tree = $this->_treeBlock->getTreeArray();
5758

5859
$this->assertNotContains('\'', $tree['children'][0]['children'][0]['children'][0]['name']);
59-
$this->assertEquals(''Category 6&#039', $tree['children'][0]['children'][0]['children'][0]['name']);
60+
$this->assertEquals(
61+
''Category 6'',
62+
$tree['children'][0]['children'][0]['children'][0]['name']
63+
);
6064
}
6165

6266
/**

0 commit comments

Comments
 (0)