1
0
Fork 0
discourse-custom-wizard-unl.../test/javascripts/acceptance/admin-custom-fields-unsuscribed-test.js

41 Zeilen
1,2 KiB
JavaScript

import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
2022-12-21 16:30:31 +01:00
import { test } from "qunit";
import { findAll, visit } from "@ember/test-helpers";
import {
getCustomFields,
getUnsubscribedAdminWizards,
getWizard,
} from "../helpers/admin-wizard";
acceptance("Admin | Custom Fields Unsuscribed", function (needs) {
needs.user();
needs.settings({
custom_wizard_enabled: true,
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
});
needs.pretender((server, helper) => {
server.get("/admin/wizards/wizard", () => {
return helper.response(getWizard);
});
server.get("/admin/wizards", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/custom-fields", () => {
return helper.response(getCustomFields);
});
});
test("Navigate to custom fields tab", async (assert) => {
await visit("/admin/wizards/custom-fields");
assert.ok(find("table"));
assert.ok(findAll("table tbody tr").length === 9);
assert.ok(
query(".message-content").innerText.includes(
"View, create, edit and destroy custom fields"
),
"it displays wizard message"
);
});
});