Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
DEV: Add admin manager destroy test
Dieser Commit ist enthalten in:
Ursprung
887057d0d2
Commit
c83e514de9
1 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen
|
@ -23,6 +23,15 @@ acceptance("Admin | Manager", function (needs) {
|
||||||
server.get("/admin/wizards/wizard", () => {
|
server.get("/admin/wizards/wizard", () => {
|
||||||
return helper.response(getWizard);
|
return helper.response(getWizard);
|
||||||
});
|
});
|
||||||
|
server.delete("/admin/wizards/manager/destroy", () => {
|
||||||
|
return helper.response({
|
||||||
|
success: "OK",
|
||||||
|
destroyed: [
|
||||||
|
{ id: "this_is_testing_wizard", name: "This is testing wizard" },
|
||||||
|
],
|
||||||
|
failures: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
test("viewing manager fields content", async (assert) => {
|
test("viewing manager fields content", async (assert) => {
|
||||||
await visit("/admin/wizards/manager");
|
await visit("/admin/wizards/manager");
|
||||||
|
@ -68,10 +77,10 @@ acceptance("Admin | Manager", function (needs) {
|
||||||
!destroyButton.hasAttribute("disabled"),
|
!destroyButton.hasAttribute("disabled"),
|
||||||
"the destroy button is enabled when destroy checkbox is clicked"
|
"the destroy button is enabled when destroy checkbox is clicked"
|
||||||
);
|
);
|
||||||
await click(destroyCheck);
|
await click("#destroy-button");
|
||||||
assert.ok(
|
assert.notOk(
|
||||||
destroyButton.hasAttribute("disabled"),
|
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
||||||
"the destroy button is disabled when destroy checkbox is unchecked"
|
"the wizard row is removed after destroy button is clicked"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Laden …
In neuem Issue referenzieren