DEV: Skip a test instead of commenting it out (#14836)

Fixes `qunit/no-commented-tests`
This commit is contained in:
Jarek Radosz 2021-11-08 21:13:58 +01:00 committed by GitHub
parent e90f506bf8
commit 34c955b5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ import bootbox from "bootbox";
import { authorizedExtensions } from "discourse/lib/uploads";
import { click, fillIn, visit } from "@ember/test-helpers";
import I18n from "I18n";
import { test } from "qunit";
import { skip, test } from "qunit";
function pretender(server, helper) {
server.post("/uploads/lookup-urls", () => {
@ -141,47 +141,47 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
appEvents.trigger("composer:add-files", [jsonFile]);
});
// Had to comment this out for now; it works fine in Ember CLI but lagging
// TODO: Had to comment this out for now; it works fine in Ember CLI but lagging
// UI updates sink it for the old Ember for some reason. Will re-enable
// when we make Ember CLI the primary.
//
// test("cancelling uploads clears the placeholders out", async function (assert) {
// await visit("/");
// await click("#create-topic");
// await fillIn(".d-editor-input", "The image:\n");
// const appEvents = loggedInUser().appEvents;
// const done = assert.async();
// appEvents.on("composer:uploads-cancelled", () => {
// assert.strictEqual(
// queryAll(".d-editor-input").val(),
// "The image:\n",
// "it should clear the cancelled placeholders"
// );
// done();
// });
skip("cancelling uploads clears the placeholders out", async function (assert) {
await visit("/");
await click("#create-topic");
await fillIn(".d-editor-input", "The image:\n");
const appEvents = loggedInUser().appEvents;
const done = assert.async();
// let uploadStarted = 0;
// appEvents.on("composer:upload-started", async () => {
// uploadStarted++;
appEvents.on("composer:uploads-cancelled", () => {
assert.strictEqual(
queryAll(".d-editor-input").val(),
"The image:\n",
"it should clear the cancelled placeholders"
);
done();
});
// if (uploadStarted === 2) {
// assert.strictEqual(
// queryAll(".d-editor-input").val(),
// "The image:\n[Uploading: avatar.png...]()\n[Uploading: avatar2.png...]()\n",
// "it should show the upload placeholders when the upload starts"
// );
// }
// });
let uploadStarted = 0;
appEvents.on("composer:upload-started", async () => {
uploadStarted++;
// appEvents.on("composer:uploads-preprocessing-complete", async () => {
// await click("#cancel-file-upload");
// });
if (uploadStarted === 2) {
assert.strictEqual(
queryAll(".d-editor-input").val(),
"The image:\n[Uploading: avatar.png...]()\n[Uploading: avatar2.png...]()\n",
"it should show the upload placeholders when the upload starts"
);
}
});
// const image = createFile("avatar.png");
// const image2 = createFile("avatar2.png");
// appEvents.trigger("composer:add-files", [image, image2]);
// });
appEvents.on("composer:uploads-preprocessing-complete", async () => {
await click("#cancel-file-upload");
});
const image = createFile("avatar.png");
const image2 = createFile("avatar2.png");
appEvents.trigger("composer:add-files", [image, image2]);
});
});
acceptance("Uppy Composer Attachment - Upload Error", function (needs) {