0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-12-01 04:51:10 +01:00
Dieser Commit ist enthalten in:
merefield 2024-05-29 15:54:34 +01:00
Ursprung 4ad6f331b3
Commit 9ec820fce8

Datei anzeigen

@ -1,5 +1,11 @@
import { getOwner } from "@ember/application"; import { getOwner } from "@ember/application";
import { click, fillIn, settled, triggerKeyEvent, visit } from "@ember/test-helpers"; import {
click,
fillIn,
settled,
triggerKeyEvent,
visit,
} from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { import {
acceptance, acceptance,
@ -23,7 +29,9 @@ acceptance("Field | Fields", function (needs) {
); );
server.get("/u/search/users", () => helper.response(usersJson)); server.get("/u/search/users", () => helper.response(usersJson));
server.post("/uploads.json", () => { server.post(
"/uploads.json",
() => {
return helper.response({ return helper.response({
extension: "jpeg", extension: "jpeg",
filesize: 126177, filesize: 126177,
@ -84,16 +92,22 @@ acceptance("Field | Fields", function (needs) {
const appEvents = getOwner(this).lookup("service:app-events"); const appEvents = getOwner(this).lookup("service:app-events");
const done = assert.async(); const done = assert.async();
appEvents.on(`${wizardComposerEdtiorEventPrefix}:all-uploads-complete`, async () => { appEvents.on(
`${wizardComposerEdtiorEventPrefix}:all-uploads-complete`,
async () => {
await settled(); await settled();
assert.ok(!exists(".wizard-btn.next.primary:disabled")); assert.ok(!exists(".wizard-btn.next.primary:disabled"));
done(); done();
}); }
);
appEvents.on(`${wizardComposerEdtiorEventPrefix}:upload-started`, async () => { appEvents.on(
await settled() `${wizardComposerEdtiorEventPrefix}:upload-started`,
async () => {
await settled();
assert.ok(exists(".wizard-btn.next.primary:disabled")); assert.ok(exists(".wizard-btn.next.primary:disabled"));
}); }
);
const image = createFile("avatar.png"); const image = createFile("avatar.png");
appEvents.trigger(`${wizardComposerEdtiorEventPrefix}:add-files`, image); appEvents.trigger(`${wizardComposerEdtiorEventPrefix}:add-files`, image);