1
0
Fork 0

DEV: frontend tests cleanup

- Fix failing test
- Handle deprecations
- Fix typos
Dieser Commit ist enthalten in:
Angus McLeod 2023-06-20 09:10:53 +02:00
Ursprung e7ab0f7143
Commit 0602e59d70
8 geänderte Dateien mit 18 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -7,7 +7,7 @@ import userSearch from "discourse/lib/user-search";
import I18n from "I18n";
import Handlebars from "handlebars";
import { isEmpty } from "@ember/utils";
import TextField from "@ember/component/text-field";
import TextField from "discourse/components/text-field";
const template = function (params) {
const options = params.options;

Datei anzeigen

@ -1,7 +1,7 @@
import computed from "discourse-common/utils/decorators";
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
import I18n from "I18n";
import TextField from "@ember/component/text-field";
import TextField from "discourse/components/text-field";
export default TextField.extend({
attributeBindings: [

Datei anzeigen

@ -4,6 +4,7 @@ import CustomWizardApi from "../models/custom-wizard-api";
import { default as discourseComputed } from "discourse-common/utils/decorators";
import { and, equal, not } from "@ember/object/computed";
import { selectKitContent } from "../lib/wizard";
import { underscore } from "@ember/string";
import Controller from "@ember/controller";
import I18n from "I18n";
@ -118,7 +119,7 @@ export default Controller.extend({
if (authType === "oauth_2") {
this.set("authorizing", true);
ajax(`/admin/wizards/apis/${name.underscore()}/authorize`)
ajax(`/admin/wizards/apis/${underscore(name)}/authorize`)
.catch(popupAjaxError)
.then((result) => {
if (result.success) {
@ -187,11 +188,11 @@ export default Controller.extend({
if (!api[rp]) {
let key = rp.replace("auth", "");
error = `${I18n.t(
`admin.wizard.api.auth.${key.underscore()}`
`admin.wizard.api.auth.${underscore(key)}`
)} is required for ${authType}`;
break;
}
data[rp.underscore()] = api[rp];
data[underscore(rp)] = api[rp];
}
}
@ -221,7 +222,7 @@ export default Controller.extend({
this.set("updating", true);
ajax(`/admin/wizards/api/${name.underscore()}`, {
ajax(`/admin/wizards/api/${underscore(name)}`, {
type: "PUT",
data,
})
@ -244,7 +245,7 @@ export default Controller.extend({
this.set("updating", true);
ajax(`/admin/wizards/api/${name.underscore()}`, {
ajax(`/admin/wizards/api/${underscore(name)}`, {
type: "DELETE",
})
.catch(popupAjaxError)
@ -262,7 +263,7 @@ export default Controller.extend({
return;
}
ajax(`/admin/wizards/api/${name.underscore()}/logs`, {
ajax(`/admin/wizards/api/${underscore(name)}/logs`, {
type: "DELETE",
})
.catch(popupAjaxError)

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.4.4
# version: 2.4.5
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech

Datei anzeigen

@ -11,6 +11,7 @@ import {
getUnsubscribedAdminWizards,
getWizard,
} from "../helpers/admin-wizard";
import { Promise } from "rsvp";
acceptance("Admin | Custom Fields Unsuscribed", function (needs) {
needs.user();
@ -83,7 +84,7 @@ acceptance("Admin | Custom Fields Unsuscribed", function (needs) {
"View, create, edit and destroy custom fields",
{ timeout: 15000 }
);
await new Ember.RSVP.Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => setTimeout(resolve, 1000));
}
test("Navigate to custom fields tab", async (assert) => {

Datei anzeigen

@ -6,6 +6,7 @@ import {
getWizard,
getWizardTestingLog,
} from "../helpers/admin-wizard";
import { Promise } from "rsvp";
acceptance("Admin | Manager", function (needs) {
needs.user();
@ -52,7 +53,7 @@ acceptance("Admin | Manager", function (needs) {
{ timeout: 15000 }
);
// Wait an additional second after the conditions are met
await new Ember.RSVP.Promise((resolve) => setTimeout(resolve, 1000));
await new Promise((resolve) => setTimeout(resolve, 1000));
}
test("viewing manager fields content", async (assert) => {

Datei anzeigen

@ -58,7 +58,7 @@ acceptance("Admin | Custom Wizard Standard Subscription", function (needs) {
assert.equal(count, 5, "There should be 5 admin tabs");
});
test("creting a new wizard", async (assert) => {
test("creating a new wizard", async (assert) => {
await visit("/admin/wizards/wizard");
await click(".admin-wizard-controls button");
assert.ok(

Datei anzeigen

@ -1,5 +1,6 @@
import {
acceptance,
exists,
query,
visible,
} from "discourse/tests/helpers/qunit-helpers";
@ -71,7 +72,7 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) {
assert.equal(count, 5, "There should be 5 admin tabs");
});
test("creting a new wizard", async (assert) => {
test("creating a new wizard", async (assert) => {
await visit("/admin/wizards/wizard");
await click(".admin-wizard-controls button");
assert.ok(
@ -441,7 +442,7 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) {
assert.strictEqual(actualResultText, "Result text", "Text is correct");
}
const fieldsContentSet = [
[6, "howto", "10"],
[6, "bug", "1"],
[7, "gazelle", "gazelle"],
];
for (let [