mirror of
https://github.com/discourse/discourse.git
synced 2025-04-27 22:54:41 +08:00
FIX: Properly close user-card after page transition (#27423)
This commit is contained in:
parent
312cf18428
commit
1ecfc397d3
@ -1,5 +1,5 @@
|
|||||||
import { getOwner } from "@ember/owner";
|
import { getOwner } from "@ember/owner";
|
||||||
import { click, visit } from "@ember/test-helpers";
|
import { click, currentURL, visit } from "@ember/test-helpers";
|
||||||
import { test } from "qunit";
|
import { test } from "qunit";
|
||||||
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
import userFixtures from "discourse/tests/fixtures/user-fixtures";
|
||||||
import {
|
import {
|
||||||
@ -10,6 +10,23 @@ import {
|
|||||||
import { cloneJSON } from "discourse-common/lib/object";
|
import { cloneJSON } from "discourse-common/lib/object";
|
||||||
import I18n from "discourse-i18n";
|
import I18n from "discourse-i18n";
|
||||||
|
|
||||||
|
acceptance("User Card", function (needs) {
|
||||||
|
needs.user();
|
||||||
|
|
||||||
|
test("opens and closes properly", async function (assert) {
|
||||||
|
await visit("/t/internationalization-localization/280");
|
||||||
|
await click('a[data-user-card="charlie"]');
|
||||||
|
|
||||||
|
assert.dom(".user-card .card-content").exists();
|
||||||
|
|
||||||
|
await click(".card-huge-avatar");
|
||||||
|
|
||||||
|
assert.strictEqual(currentURL(), "/u/charlie/summary");
|
||||||
|
assert.dom(".user-card").doesNotExist();
|
||||||
|
assert.dom(".card-content").doesNotExist();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
acceptance("User Card - Show Local Time", function (needs) {
|
acceptance("User Card - Show Local Time", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
needs.settings({ display_local_time_in_user_card: true });
|
needs.settings({ display_local_time_in_user_card: true });
|
||||||
|
@ -112,6 +112,7 @@ export default class DMenuInstance extends FloatKitInstance {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
destroy() {
|
destroy() {
|
||||||
|
this.close();
|
||||||
this.tearDownListeners();
|
this.tearDownListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,7 @@ export default class DTooltipInstance extends FloatKitInstance {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
destroy() {
|
destroy() {
|
||||||
|
this.close();
|
||||||
this.tearDownListeners();
|
this.tearDownListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user