Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
DEV: Add waiting for the default message
Dieser Commit ist enthalten in:
Ursprung
c83e514de9
Commit
69dc96562d
1 geänderte Dateien mit 20 neuen und 1 gelöschten Zeilen
|
@ -1,6 +1,6 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, find, findAll, visit } from "@ember/test-helpers";
|
||||
import { click, find, findAll, visit, waitUntil } from "@ember/test-helpers";
|
||||
import {
|
||||
getUnsubscribedAdminWizards,
|
||||
getWizard,
|
||||
|
@ -33,6 +33,24 @@ acceptance("Admin | Manager", function (needs) {
|
|||
});
|
||||
});
|
||||
});
|
||||
async function waitForDestructionAndResetMessage() {
|
||||
// Wait for the "Destruction complete" message to appear
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"Destruction complete",
|
||||
{ timeout: 5000 }
|
||||
);
|
||||
|
||||
// Wait for the message to change back to the original text
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"Export, import or destroy wizards",
|
||||
{ timeout: 15000 }
|
||||
);
|
||||
}
|
||||
|
||||
test("viewing manager fields content", async (assert) => {
|
||||
await visit("/admin/wizards/manager");
|
||||
assert.ok(
|
||||
|
@ -78,6 +96,7 @@ acceptance("Admin | Manager", function (needs) {
|
|||
"the destroy button is enabled when destroy checkbox is clicked"
|
||||
);
|
||||
await click("#destroy-button");
|
||||
await waitForDestructionAndResetMessage();
|
||||
assert.notOk(
|
||||
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
||||
"the wizard row is removed after destroy button is clicked"
|
||||
|
|
Laden …
In neuem Issue referenzieren