FIX: handles starting draft dm from sidebar (#18946)

This commit is contained in:
Joffrey JAFFEUX
2022-11-08 23:58:11 +01:00
committed by GitHub
parent f8f55cef67
commit 074aa5eb5e
4 changed files with 54 additions and 20 deletions
@@ -5,14 +5,7 @@ import {
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import {
click,
currentURL,
fillIn,
settled,
triggerKeyEvent,
visit,
} from "@ember/test-helpers";
import { click, currentURL, settled, visit } from "@ember/test-helpers";
import { directMessageChannels } from "discourse/plugins/chat/chat-fixtures";
import { cloneJSON } from "discourse-common/lib/object";
import I18n from "I18n";
@@ -421,13 +414,11 @@ acceptance("Discourse Chat - Core Sidebar", function (needs) {
test("Open a new direct conversation", async function (assert) {
await visit("/");
await click(".sidebar-section-chat-dms .sidebar-section-header-button");
assert.ok(exists(".direct-message-creator"));
await fillIn(".filter-usernames", "hawk");
await triggerKeyEvent(".filter-usernames", "keydown", "Enter");
assert.strictEqual(currentURL(), "/chat/draft-channel");
assert.ok(exists(".direct-message-creator"));
assert.ok(exists(".topic-chat-container.expanded.visible"));
assert.strictEqual(currentURL(), "/");
});
test("Escapes public channel titles", async function (assert) {