Commit c7bd0811 authored by borisson_'s avatar borisson_ Committed by borisson_
Browse files

Issue #2840579 by borisson_, ckng, Mirnaxvb: 'is-active' class is not in array

parent 6c9fb1f2
......@@ -167,7 +167,7 @@ abstract class WidgetPluginBase extends PluginBase implements WidgetPluginInterf
}
if ($result->isActive()) {
$items['#attributes'] = ['class' => 'is-active'];
$items['#attributes'] = ['class' => ['is-active']];
}
$items['#wrapper_attributes'] = ['class' => $classes];
......
......@@ -78,7 +78,7 @@ class LinksWidgetTest extends WidgetTestBase {
$this->assertEquals($value, $output['#items'][$index]['#title']);
$this->assertEquals('link', $output['#items'][$index]['#type']);
if ($index === 0 || $index === 3) {
$this->assertEquals('is-active', $output['#items'][$index]['#attributes']['class']);
$this->assertEquals(['is-active'], $output['#items'][$index]['#attributes']['class']);
}
$this->assertEquals(['facet-item'], $output['#items'][$index]['#wrapper_attributes']['class']);
}
......@@ -111,7 +111,7 @@ class LinksWidgetTest extends WidgetTestBase {
$this->assertEquals($value, $output['#items'][$index]['#title']);
$this->assertEquals('link', $output['#items'][$index]['#type']);
if ($index === 1) {
$this->assertEquals('is-active', $output['#items'][$index]['#attributes']['class']);
$this->assertEquals(['is-active'], $output['#items'][$index]['#attributes']['class']);
}
$this->assertEquals(['facet-item'], $output['#items'][$index]['#wrapper_attributes']['class']);
}
......@@ -136,7 +136,7 @@ class LinksWidgetTest extends WidgetTestBase {
$this->assertEquals($value, $output['#items'][$index]['#title']);
$this->assertEquals('link', $output['#items'][$index]['#type']);
if ($index === 1) {
$this->assertEquals('is-active', $output['#items'][$index]['#attributes']['class']);
$this->assertEquals(['is-active'], $output['#items'][$index]['#attributes']['class']);
}
$this->assertEquals(['facet-item'], $output['#items'][$index]['#wrapper_attributes']['class']);
}
......@@ -172,7 +172,7 @@ class LinksWidgetTest extends WidgetTestBase {
$this->assertEquals($value, $output['#items'][$index]['#title']);
$this->assertEquals('link', $output['#items'][$index]['#type']);
if ($index === 1) {
$this->assertEquals('is-active', $output['#items'][$index]['#attributes']['class']);
$this->assertEquals(['is-active'], $output['#items'][$index]['#attributes']['class']);
$this->assertEquals(['facet-item', 'facet-item--expanded'], $output['#items'][$index]['#wrapper_attributes']['class']);
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment