mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Cover viewing_only_enabled_taxons_in_taxon_menu.feature scenario
This commit is contained in:
parent
f3c6463e7a
commit
1f9e9419c0
3 changed files with 4 additions and 12 deletions
|
|
@ -12,15 +12,7 @@ Feature: Viewing only enabled taxons in taxon menu
|
|||
And the "Accessories" taxon has children taxons "Caps" and "Belts"
|
||||
And channel "United States" has menu taxon "Category"
|
||||
|
||||
@ui
|
||||
Scenario: Viewing only enabled taxons in taxon menu
|
||||
Given the "Clothes" taxon is disabled
|
||||
And the "Belts" taxon is disabled
|
||||
When I check available taxons
|
||||
Then I should see "Accessories Caps" and "Caps" in the menu
|
||||
And I should not see "Clothes", "T-Shirts", "Coats" and "Belts" in the menu
|
||||
|
||||
@api
|
||||
@api @ui
|
||||
Scenario: Viewing only enabled taxons in taxon menu
|
||||
Given the "Clothes" taxon is disabled
|
||||
And the "Belts" taxon is disabled
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ final class MenuElement extends Element implements MenuElementInterface
|
|||
{
|
||||
$menu = $this->getElement('menu');
|
||||
|
||||
return array_map(fn (NodeElement $element): string => $element->getText(), $menu->findAll('css', '[data-test-menu-item]'));
|
||||
return array_map(fn (NodeElement $element): string => $element->getAttribute('data-test-menu-item'), $menu->findAll('css', '[data-test-menu-item]'));
|
||||
}
|
||||
|
||||
protected function getDefinedElements(): array
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
{% import _self as macros %}
|
||||
|
||||
{% if taxon.enabledChildren|length > 0 %}
|
||||
<div class="ui dropdown item" {{ sylius_test_html_attribute('menu-item') }}>
|
||||
<div class="ui dropdown item" {{ sylius_test_html_attribute('menu-item', taxon.name) }}>
|
||||
<span class="text">{{ taxon.name }}</span>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="item" {{ sylius_test_html_attribute('menu-item') }}>{{ taxon.name }}</a>
|
||||
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="item" {{ sylius_test_html_attribute('menu-item', taxon.name) }}>{{ taxon.name }}</a>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue