FIX: Chat member user card rendered out of view (#20332)

This commit is contained in:
Jan Cernik
2023-02-17 10:14:00 -03:00
committed by GitHub
parent a0b83dac86
commit f48e25b215
5 changed files with 45 additions and 12 deletions

View File

@ -0,0 +1,24 @@
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { render } from "@ember/test-helpers";
module("Discourse Chat | Component | chat-user-info", function (hooks) {
setupRenderingTest(hooks);
test("avatar and name", async function (assert) {
this.set("user", this.currentUser);
await render(hbs`<ChatUserInfo @user={{this.user}} />`);
assert
.dom(`a[data-user-card=${this.user.username}] div.chat-user-avatar`)
.exists();
assert
.dom(
`a[data-user-card=${this.user.username}] span.chat-user-display-name`
)
.includesText(this.user.username);
});
});