Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
Apply prettier and eslint
Dieser Commit ist enthalten in:
Ursprung
f3aed50927
Commit
7f233f178c
4 geänderte Dateien mit 15 neuen und 21 gelöschten Zeilen
|
@ -128,7 +128,6 @@ export default Controller.extend({
|
||||||
const api = this.get("api");
|
const api = this.get("api");
|
||||||
const name = api.name;
|
const name = api.name;
|
||||||
const authType = api.authType;
|
const authType = api.authType;
|
||||||
let refreshList = false; // eslint-disable-line
|
|
||||||
let error;
|
let error;
|
||||||
|
|
||||||
if (!name || !authType) {
|
if (!name || !authType) {
|
||||||
|
@ -143,11 +142,6 @@ export default Controller.extend({
|
||||||
data["title"] = api.title;
|
data["title"] = api.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
const originalTitle = this.get("api.originalTitle");
|
|
||||||
if (api.get("isNew") || (originalTitle && api.title !== originalTitle)) {
|
|
||||||
refreshList = true; // eslint-disable-line
|
|
||||||
}
|
|
||||||
|
|
||||||
if (api.get("isNew")) {
|
if (api.get("isNew")) {
|
||||||
data["new"] = true;
|
data["new"] = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { test } from "qunit";
|
||||||
import {
|
import {
|
||||||
acceptance,
|
acceptance,
|
||||||
count,
|
count,
|
||||||
query,
|
|
||||||
exists,
|
exists,
|
||||||
|
query,
|
||||||
visible,
|
visible,
|
||||||
} from "discourse/tests/helpers/qunit-helpers";
|
} from "discourse/tests/helpers/qunit-helpers";
|
||||||
import { allFieldsWizard } from "../helpers/wizard";
|
import { allFieldsWizard } from "../helpers/wizard";
|
||||||
|
@ -13,11 +13,11 @@ import usersJson from "../fixtures/users";
|
||||||
|
|
||||||
acceptance("Field | Fields", function (needs) {
|
acceptance("Field | Fields", function (needs) {
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) => helper.response(allFieldsWizard));
|
server.get("/w/wizard.json", () => helper.response(allFieldsWizard));
|
||||||
server.get("/tags/filter/search", (request) =>
|
server.get("/tags/filter/search", () =>
|
||||||
helper.response({ results: tagsJson["tags"] })
|
helper.response({ results: tagsJson["tags"] })
|
||||||
);
|
);
|
||||||
server.get("/u/search/users", (request) => helper.response(usersJson));
|
server.get("/u/search/users", () => helper.response(usersJson));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Text", async function (assert) {
|
test("Text", async function (assert) {
|
||||||
|
|
|
@ -3,15 +3,15 @@ import { test } from "qunit";
|
||||||
import {
|
import {
|
||||||
acceptance,
|
acceptance,
|
||||||
count,
|
count,
|
||||||
query,
|
|
||||||
exists,
|
exists,
|
||||||
|
query,
|
||||||
visible,
|
visible,
|
||||||
} from "discourse/tests/helpers/qunit-helpers";
|
} from "discourse/tests/helpers/qunit-helpers";
|
||||||
import { stepNotPermitted, wizard, update } from "../helpers/wizard";
|
import { stepNotPermitted, update, wizard } from "../helpers/wizard";
|
||||||
|
|
||||||
acceptance("Step | Not permitted", function (needs) {
|
acceptance("Step | Not permitted", function (needs) {
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) =>
|
server.get("/w/wizard.json", () =>
|
||||||
helper.response(stepNotPermitted)
|
helper.response(stepNotPermitted)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -24,8 +24,8 @@ acceptance("Step | Not permitted", function (needs) {
|
||||||
|
|
||||||
acceptance("Step | Step", function (needs) {
|
acceptance("Step | Step", function (needs) {
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) => helper.response(wizard));
|
server.get("/w/wizard.json", () => helper.response(wizard));
|
||||||
server.put("/w/wizard/steps/:step_id", (request) =>
|
server.put("/w/wizard/steps/:step_id", () =>
|
||||||
helper.response(update)
|
helper.response(update)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { visit, settled } from "@ember/test-helpers";
|
import { visit } from "@ember/test-helpers";
|
||||||
import { test } from "qunit";
|
import { test } from "qunit";
|
||||||
import {
|
import {
|
||||||
acceptance,
|
acceptance,
|
||||||
count,
|
count,
|
||||||
query,
|
|
||||||
exists,
|
exists,
|
||||||
|
query,
|
||||||
} from "discourse/tests/helpers/qunit-helpers";
|
} from "discourse/tests/helpers/qunit-helpers";
|
||||||
import {
|
import {
|
||||||
wizard,
|
wizard,
|
||||||
|
@ -15,7 +15,7 @@ import {
|
||||||
|
|
||||||
acceptance("Wizard | Not logged in", function (needs) {
|
acceptance("Wizard | Not logged in", function (needs) {
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) => helper.response(wizardNoUser));
|
server.get("/w/wizard.json", () => helper.response(wizardNoUser));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Wizard no access requires login", async function (assert) {
|
test("Wizard no access requires login", async function (assert) {
|
||||||
|
@ -27,7 +27,7 @@ acceptance("Wizard | Not logged in", function (needs) {
|
||||||
acceptance("Wizard | Not permitted", function (needs) {
|
acceptance("Wizard | Not permitted", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) =>
|
server.get("/w/wizard.json", () =>
|
||||||
helper.response(wizardNotPermitted)
|
helper.response(wizardNotPermitted)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -41,7 +41,7 @@ acceptance("Wizard | Not permitted", function (needs) {
|
||||||
acceptance("Wizard | Completed", function (needs) {
|
acceptance("Wizard | Completed", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) => helper.response(wizardCompleted));
|
server.get("/w/wizard.json", () => helper.response(wizardCompleted));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Wizard no access completed", async function (assert) {
|
test("Wizard no access completed", async function (assert) {
|
||||||
|
@ -53,7 +53,7 @@ acceptance("Wizard | Completed", function (needs) {
|
||||||
acceptance("Wizard | Wizard", function (needs) {
|
acceptance("Wizard | Wizard", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
server.get("/w/wizard.json", (request) => {
|
server.get("/w/wizard.json", () => {
|
||||||
return helper.response(wizard);
|
return helper.response(wizard);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Laden …
In neuem Issue referenzieren