[FIX] *: adapt QUnit tests and tours

[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
This commit is contained in:
Pierre Paridans
2023-05-12 22:59:22 +02:00
parent 3aaa0bfff1
commit eef262abf4
112 changed files with 3673 additions and 2329 deletions
@@ -46,9 +46,9 @@ function compileChatter(node, params) {
hasParentReloadOnFollowersUpdate,
hasParentReloadOnMessagePosted,
isAttachmentBoxVisibleInitially,
threadId: "__comp__.props.record.model.root.resId or undefined",
threadModel: "__comp__.props.record.model.root.resModel",
webRecord: "__comp__.props.record.model.root",
threadId: "__comp__.props.record.resId or undefined",
threadModel: "__comp__.props.record.resModel",
webRecord: "__comp__.props.record",
saveRecord: "() => __comp__.saveButtonClicked and __comp__.saveButtonClicked()",
});
const chatterContainerHookXml = createElement("div");
@@ -63,8 +63,8 @@ function compileAttachmentPreview(node, params) {
const webClientViewAttachmentViewContainerXml = createElement("t");
setAttributes(webClientViewAttachmentViewContainerXml, {
"t-component": "__comp__.mailComponents.AttachmentView",
threadId: "__comp__.props.record.model.root.resId or undefined",
threadModel: "__comp__.props.record.model.root.resModel",
threadId: "__comp__.props.record.resId or undefined",
threadModel: "__comp__.props.record.resModel",
});
append(webClientViewAttachmentViewContainerHookXml, webClientViewAttachmentViewContainerXml);
return webClientViewAttachmentViewContainerHookXml;
@@ -1994,6 +1994,6 @@ QUnit.test(
await click(".o-mail-NotificationItem:contains(General)");
await click(".o-mail-ChatWindow [title='Open in Discuss']");
await click(".o-mail-DiscussCategoryItem:contains(General) [title='Channel settings']");
assert.strictEqual($(".breadcrumb").text(), "DiscussGeneral");
assert.strictEqual($(".o_breadcrumb").text(), "DiscussGeneral");
}
);
@@ -190,10 +190,10 @@ QUnit.test("Composer type is kept when switching from aside to bottom", async (a
});
assert.hasClass(
$("button:contains(Log note)"),
"btn-odoo",
"btn-primary",
"Active button should be the log note button"
);
assert.doesNotHaveClass($("button:contains(Send message)"), "btn-odoo");
assert.doesNotHaveClass($("button:contains(Send message)"), "btn-primary");
});
QUnit.test("chatter: drop attachments", async (assert) => {
@@ -54,5 +54,8 @@ QUnit.test("Manage Messages", async (assert) => {
await click(dropdownItems[0]);
await legacyExtraNextTick();
assert.verifySteps(["message_read"]);
assert.strictEqual($(".breadcrumb-item.active")[0].innerText.trim(), "Manage Messages");
assert.strictEqual(
target.querySelector(".o_breadcrumb .active > span").innerText.trim(),
"Manage Messages"
);
});
@@ -330,9 +330,9 @@ QUnit.test(
views: [[false, "form"]],
});
assert.strictEqual(
$(".o_field_many2many_avatar_user.o_field_widget .badge img")[0].getAttribute(
"data-src"
),
document.body
.querySelector(".o_field_many2many_avatar_user.o_field_widget .o_avatar img")
.getAttribute("data-src"),
`/web/image/res.users/${userId}/avatar_128`
);
}
@@ -374,7 +374,7 @@ QUnit.test("many2many_avatar_user widget in form view", async (assert) => {
res_id: avatarUserId,
views: [[false, "form"]],
});
await click(document.body, ".o_field_many2many_avatar_user .badge .o_m2m_avatar");
await click(document.body, ".o_field_many2many_avatar_user .o_avatar img");
assert.containsOnce($, ".o-mail-ChatWindow");
assert.strictEqual($(".o-mail-ChatWindow-name").text(), "Partner 1");
});
@@ -70,12 +70,12 @@ QUnit.test("Form view not scrolled when switching record", async (assert) => {
},
{ resIds: [partnerId_1, partnerId_2] }
);
assert.strictEqual($(".breadcrumb-item.active").text(), "Partner 1");
assert.strictEqual($(".o_breadcrumb .active").text(), "Partner 1");
assert.strictEqual($(".o_content")[0].scrollTop, 0);
$(".o_content")[0].scrollTop = 150;
await click(".o_pager_next");
assert.strictEqual($(".breadcrumb-item.active").text(), "Partner 2");
assert.strictEqual($(".o_breadcrumb .active").text(), "Partner 2");
assert.strictEqual($(".o_content")[0].scrollTop, 0);
await click(".o_pager_previous");