Files
odoo_source/addons/mail/static/tests/web/fields/avatar_tests.js
T
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00

29 lines
995 B
JavaScript

/** @odoo-module **/
import { click, start } from "@mail/../tests/helpers/test_utils";
import { Avatar } from "@mail/web/fields/avatar/avatar";
import { getFixture, mount } from "@web/../tests/helpers/utils";
QUnit.module("avatar field");
QUnit.test("basic rendering", async (assert) => {
const { env } = await start();
await mount(Avatar, getFixture(), {
env,
props: {
resId: 2,
resModel: "res.users",
displayName: "User display name",
},
});
assert.containsOnce($, ".o-mail-Avatar");
assert.containsOnce($, ".o-mail-Avatar img");
assert.strictEqual($(".o-mail-Avatar img")[0].dataset.src, "/web/image/res.users/2/avatar_128");
assert.containsOnce($, ".o-mail-Avatar span");
assert.strictEqual($(".o-mail-Avatar span")[0].innerText, "User display name");
assert.containsNone($, ".o-mail-ChatWindow");
await click(".o-mail-Avatar img");
assert.containsOnce($, ".o-mail-ChatWindow");
});