Skip to content

Commit

Permalink
[FIX] test_main_flows: avoid useless click in burger menu
Browse files Browse the repository at this point in the history
As all burger menu items are unfolded now, it is no longer necessary
to click to open sub menus.

Part-of: odoo#88073
  • Loading branch information
adr-odoo authored and pparidans committed Sep 5, 2022
1 parent 8b96a8a commit f28781b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</ul>
</li>
<li t-else="" t-on-click="() => this._onMenuClicked(section)" t-att-data-menu-xmlid="section.xmlid"
class="d-block py-3" t-att-class="{ 'fs-4': !isNested }">
class="py-3" t-att-class="{ 'fs-4': !isNested }">
<t t-esc="section.name"/>
</li>
</t>
Expand Down
8 changes: 4 additions & 4 deletions addons/web/static/tests/mobile/burger_menu_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ QUnit.test("Burger Menu on an App", async (assert) => {
assert.containsOnce(document.body, ".o_burger_menu");
assert.containsOnce(
document.body,
".o_burger_menu .o_burger_menu_app .o_menu_sections .dropdown-item"
".o_burger_menu nav.o_burger_menu_content li"
);
assert.strictEqual(
document.body.querySelector(
".o_burger_menu .o_burger_menu_app .o_menu_sections .dropdown-item"
".o_burger_menu nav.o_burger_menu_content li"
).textContent,
"SubMenu"
);
Expand Down Expand Up @@ -146,11 +146,11 @@ QUnit.test("Burger menu closes when click on menu item", async (assert) => {
assert.containsOnce(document.body, ".o_burger_menu");
assert.strictEqual(
document.body.querySelector(
".o_burger_menu .o_burger_menu_app .o_menu_sections .dropdown-item"
".o_burger_menu nav.o_burger_menu_content li"
).textContent,
"SubMenu"
);
await click(document.body, ".o_burger_menu .o_burger_menu_app .o_menu_sections .dropdown-item");
await click(document.body, ".o_burger_menu nav.o_burger_menu_content li");
await legacyExtraNextTick();
await legacyExtraNextTick();
assert.containsNone(document.body, ".o_burger_menu");
Expand Down
39 changes: 6 additions & 33 deletions odoo/addons/test_main_flows/static/tests/tours/main_flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ tour.register('main_flow_tour', {
tour.stepUtils.openBuggerMenu("li.breadcrumb-item.active:contains('Quotations')"),
{
// Add Stockable product
mobile: false,
trigger: ".o_menu_sections .dropdown-toggle span:contains('Products')",
extra_trigger: '.o_main_navbar',
content: _t("Let's create products."),
position: "bottom",
}, {
trigger: ".o_menu_sections .dropdown-item:contains('Products'), nav.o_burger_menu_content li:contains('Products')",
trigger: ".o_menu_sections .dropdown-item:contains('Products'), nav.o_burger_menu_content li[data-menu-xmlid='sale.menu_product_template_action']",
content: _t("Let's create products."),
position: "bottom"
}, {
Expand Down Expand Up @@ -634,26 +635,9 @@ tour.stepUtils.openBuggerMenu("li.breadcrumb-item.active:contains('Inventory Ove
content: _t("Go to Configuration"),
position: "bottom"
}, {
mobile: false,
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='stock.menu_reordering_rules_config']",
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='stock.menu_reordering_rules_config'], nav.o_burger_menu_content li[data-menu-xmlid='stock.menu_reordering_rules_config']",
content: _t("Reordering Rules"),
position: "bottom"
}, {
mobile: true,
trigger: ".o_menu_sections button:contains('Configuration')",
extra_trigger: '.o_main_navbar',
content: _t("Go to Configuration"),
position: "bottom"
}, {
mobile: true,
trigger: ".o_menu_sections button[data-menu-xmlid='stock.menu_product_in_config_stock']",
content: _t("Click on Product Section"),
position: "bottom"
}, {
mobile: true,
trigger: ".o_menu_sections .dropdown-item:not(.o_dropdown):contains('Reordering Rules')",
content: _t("Click on Product Section"),
position: "bottom"
}, {
mobile: false,
trigger: ".o_list_button_add",
Expand Down Expand Up @@ -767,26 +751,14 @@ tour.stepUtils.openBuggerMenu("li.breadcrumb-item.active:contains('Manufacturing
content: _t('Click on Operations menuitem'),
position: 'bottom',
}, {
mobile: false,
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='mrp.menu_mrp_production_action']",
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='mrp.menu_mrp_production_action'], nav.o_burger_menu_content li[data-menu-xmlid='mrp.menu_mrp_production_action']",
content: _t('Open manufacturing orders'),
position: 'bottom',
}, {
mobile: false,
trigger: '.o_data_row:has(.o_data_cell:contains("the_flow.product")):first .o_data_cell:first',
content: _t('Select the generated manufacturing order'),
position: 'bottom',
}, {
mobile: true,
trigger: ".o_menu_sections button:contains('Operations')",
extra_trigger: '.o_main_navbar',
content: _t("Let's go to manufacturing order."),
position: "bottom",
}, {
mobile: true,
trigger: ".o_menu_sections .dropdown-item:contains('Manufacturing Orders')",
content: _t("Let's go to manufacturing order."),
position: "bottom"
}, {
mobile: true,
trigger: '.o_kanban_record:has(.o_kanban_record_title:contains("the_flow.product")):first',
Expand Down Expand Up @@ -814,11 +786,12 @@ tour.stepUtils.openBuggerMenu("li.breadcrumb-item.active:contains('Manufacturing
...tour.stepUtils.goToAppSteps('sale.sale_menu_root', Markup(_t('Organize your sales activities with the <b>Sales app</b>.'))),
tour.stepUtils.openBuggerMenu("li.breadcrumb-item.active:contains('Quotations')"),
{
mobile: false,
trigger: ".o_menu_sections button[data-menu-xmlid='sale.sale_order_menu']",
content: _t("Go to Sales menu"),
position: "bottom"
}, {
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='sale.menu_sale_order']",
trigger: ".o_menu_sections .dropdown-item[data-menu-xmlid='sale.menu_sale_order'], nav.o_burger_menu_content li[data-menu-xmlid='sale.menu_sale_order']",
content: _t("Go to the sales orders"),
position: "bottom"
}, {
Expand Down

0 comments on commit f28781b

Please sign in to comment.