Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
DEV: Add waiting for inserted element to disappear
Dieser Commit ist enthalten in:
Ursprung
69dc96562d
Commit
537ffeb883
1 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen
|
@ -34,7 +34,6 @@ acceptance("Admin | Manager", function (needs) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
async function waitForDestructionAndResetMessage() {
|
async function waitForDestructionAndResetMessage() {
|
||||||
// Wait for the "Destruction complete" message to appear
|
|
||||||
await waitUntil(
|
await waitUntil(
|
||||||
() =>
|
() =>
|
||||||
document.querySelector(".message-content")?.innerText ===
|
document.querySelector(".message-content")?.innerText ===
|
||||||
|
@ -42,11 +41,11 @@ acceptance("Admin | Manager", function (needs) {
|
||||||
{ timeout: 5000 }
|
{ timeout: 5000 }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Wait for the message to change back to the original text
|
|
||||||
await waitUntil(
|
await waitUntil(
|
||||||
() =>
|
() =>
|
||||||
document.querySelector(".message-content")?.innerText ===
|
document.querySelector(".message-content")?.innerText ===
|
||||||
"Export, import or destroy wizards",
|
"Export, import or destroy wizards" &&
|
||||||
|
!document.querySelector(".message-content")?.nextElementSibling,
|
||||||
{ timeout: 15000 }
|
{ timeout: 15000 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -96,10 +95,10 @@ acceptance("Admin | Manager", function (needs) {
|
||||||
"the destroy button is enabled when destroy checkbox is clicked"
|
"the destroy button is enabled when destroy checkbox is clicked"
|
||||||
);
|
);
|
||||||
await click("#destroy-button");
|
await click("#destroy-button");
|
||||||
await waitForDestructionAndResetMessage();
|
|
||||||
assert.notOk(
|
assert.notOk(
|
||||||
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
||||||
"the wizard row is removed after destroy button is clicked"
|
"the wizard row is removed after destroy button is clicked"
|
||||||
);
|
);
|
||||||
|
await waitForDestructionAndResetMessage();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Laden …
In neuem Issue referenzieren