mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Open a card on click even if the mention has extra elements (#8626)
Plugins like https://github.com/discourse/discourse-calendar add extra HTML (e.g. icons) to user/group mentions. Clicking on those extra elements used to only flash a blank card. Now, the card opens properly.
This commit is contained in:
@@ -9,6 +9,13 @@ QUnit.test("user card", async assert => {
|
||||
|
||||
await click("a[data-user-card=eviltrout]:first");
|
||||
assert.ok(visible("#user-card"), "card should appear");
|
||||
assert.equal(
|
||||
find("#user-card .username")
|
||||
.text()
|
||||
.trim(),
|
||||
"eviltrout",
|
||||
"user card contains the data"
|
||||
);
|
||||
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
await click(".card-content a.user-profile-link");
|
||||
@@ -19,10 +26,31 @@ QUnit.test("user card", async assert => {
|
||||
|
||||
await click("a[data-user-card=charlie]:first");
|
||||
assert.ok(visible("#user-card"), "card should appear");
|
||||
assert.equal(
|
||||
find("#user-card .username")
|
||||
.text()
|
||||
.trim(),
|
||||
"charlie",
|
||||
"user card contains the data"
|
||||
);
|
||||
|
||||
await click(".card-content .compose-pm button");
|
||||
assert.ok(
|
||||
invisible("#user-card"),
|
||||
"user card dismissed after hitting Message button"
|
||||
);
|
||||
|
||||
const mention = find("a.mention");
|
||||
const icon = document.createElement("span");
|
||||
icon.classList.add("icon");
|
||||
mention.append(icon);
|
||||
await click("a.mention .icon");
|
||||
assert.ok(visible("#user-card"), "card should appear");
|
||||
assert.equal(
|
||||
find("#user-card .username")
|
||||
.text()
|
||||
.trim(),
|
||||
"eviltrout",
|
||||
"user card contains the data"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user