DEV: Fix and unskip flaky specs (#22005)
These specs were skipped in d6d5eae1
. They sometimes failed, and only on CI,
not in GitHub Actions.
I wasn't able to reproduce failures locally, but I expect clicking the send button
in chat composer should be more reliable than emulating pressing <kbd>Enter</kbd>.
This commit is contained in:
parent
ccf18b5e44
commit
44eabde12f
|
@ -5,14 +5,8 @@ import {
|
|||
publishToMessageBus,
|
||||
query,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { skip, test } from "qunit";
|
||||
import {
|
||||
click,
|
||||
triggerEvent,
|
||||
triggerKeyEvent,
|
||||
visit,
|
||||
waitFor,
|
||||
} from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, triggerEvent, visit, waitFor } from "@ember/test-helpers";
|
||||
import pretender, { OK } from "discourse/tests/helpers/create-pretender";
|
||||
|
||||
acceptance("Chat | User status on mentions", function (needs) {
|
||||
|
@ -100,7 +94,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
setupAutocompleteResponses([mentionedUser2, mentionedUser3]);
|
||||
});
|
||||
|
||||
skip("just posted messages | it shows status on mentions ", async function (assert) {
|
||||
test("just posted messages | it shows status on mentions ", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
await typeWithAutocompleteAndSend(`mentioning @${mentionedUser2.username}`);
|
||||
assertStatusIsRendered(
|
||||
|
@ -110,7 +104,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
);
|
||||
});
|
||||
|
||||
skip("just posted messages | it updates status on mentions", async function (assert) {
|
||||
test("just posted messages | it updates status on mentions", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
await typeWithAutocompleteAndSend(`mentioning @${mentionedUser2.username}`);
|
||||
|
||||
|
@ -123,7 +117,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
assertStatusIsRendered(assert, selector, newStatus);
|
||||
});
|
||||
|
||||
skip("just posted messages | it deletes status on mentions", async function (assert) {
|
||||
test("just posted messages | it deletes status on mentions", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
|
||||
await typeWithAutocompleteAndSend(`mentioning @${mentionedUser2.username}`);
|
||||
|
@ -137,7 +131,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
assert.dom(selector).doesNotExist("status is deleted");
|
||||
});
|
||||
|
||||
skip("edited messages | it shows status on mentions", async function (assert) {
|
||||
test("edited messages | it shows status on mentions", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
|
||||
await editMessage(
|
||||
|
@ -152,7 +146,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
);
|
||||
});
|
||||
|
||||
skip("edited messages | it updates status on mentions", async function (assert) {
|
||||
test("edited messages | it updates status on mentions", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
await editMessage(
|
||||
".chat-message-content",
|
||||
|
@ -168,7 +162,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
assertStatusIsRendered(assert, selector, newStatus);
|
||||
});
|
||||
|
||||
skip("edited messages | it deletes status on mentions", async function (assert) {
|
||||
test("edited messages | it deletes status on mentions", async function (assert) {
|
||||
await visit(`/chat/c/-/${channelId}`);
|
||||
|
||||
await editMessage(
|
||||
|
@ -318,7 +312,7 @@ acceptance("Chat | User status on mentions", function (needs) {
|
|||
async function typeWithAutocompleteAndSend(text) {
|
||||
await emulateAutocomplete(".chat-composer__input", text);
|
||||
await click(".autocomplete.ac-user .selected");
|
||||
await triggerKeyEvent(".chat-composer__input", "keydown", "Enter");
|
||||
await click(".chat-composer-button.-send");
|
||||
}
|
||||
|
||||
function setupAutocompleteResponses(results) {
|
||||
|
|
Loading…
Reference in New Issue