0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-19 23:31:11 +02:00

make code testable, add test

Dieser Commit ist enthalten in:
merefield 2023-09-08 07:13:52 +01:00
Ursprung 8649ab2286
Commit 050a38a9d3
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -31,7 +31,7 @@ export default {
.concat(["loading"]); .concat(["loading"]);
if ( if (
redirectToWizard && redirectToWizard &&
!searchParams.has("ignore_redirect") && !data.url.includes("ignore_redirect") &&
data.currentRouteName !== "customWizardStep" && data.currentRouteName !== "customWizardStep" &&
!excludedPaths.find((p) => { !excludedPaths.find((p) => {
return data.currentRouteName.indexOf(p) > -1; return data.currentRouteName.indexOf(p) > -1;

Datei anzeigen

@ -74,6 +74,15 @@ acceptance("Wizard | Redirect", function (needs) {
"pending wizard routing works" "pending wizard routing works"
); );
}); });
test("Don't redirect to pending Wizard when ingore redirect param is supplied", async function (assert) {
sinon.stub(DiscourseURL, "routeTo");
await visit("/latest?ignore_redirect=1");
assert.notOk(
DiscourseURL.routeTo.calledWith("/w/wizard"),
"pending wizard routing blocked"
);
});
}); });
acceptance("Wizard | Wizard", function (needs) { acceptance("Wizard | Wizard", function (needs) {