mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:11:08 -06:00
DEV: Skip a test instead of commenting it out (#14836)
Fixes `qunit/no-commented-tests`
This commit is contained in:
parent
e90f506bf8
commit
34c955b5ec
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user