From 63dd08ad59b9022aff6371734044b168360240d0 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 13 Mar 2024 10:32:45 +0800 Subject: [PATCH] DEV: Fix build due to 3a4f4abdc9d6a1dbbd1535726bbf5931a5c37e1c (#26151) --- .../editor-test.gjs | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs index 58c73147e7e..affff6c7741 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs +++ b/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs @@ -7,6 +7,7 @@ import { queryAll } from "discourse/tests/helpers/qunit-helpers"; import selectKit from "discourse/tests/helpers/select-kit-helper"; import I18n from "discourse-i18n"; import AdminSchemaThemeSettingEditor from "admin/components/schema-theme-setting/editor"; +import ThemeSettings from "admin/models/theme-settings"; class TreeFromDOM { constructor() { @@ -294,29 +295,33 @@ module( }); test("input fields are rendered even if they're not present in the data", async function (assert) { - const schema = { - name: "something", - identifier: "id", - properties: { - id: { - type: "string", - }, - name: { - type: "string", + const setting = ThemeSettings.create({ + setting: "objects_setting", + objects_schema: { + name: "something", + identifier: "id", + properties: { + id: { + type: "string", + }, + name: { + type: "string", + }, }, }, - }; - const data = [ - { - id: "bu1", - name: "Big U", - }, - { - id: "fi2", - }, - ]; + value: [ + { + id: "bu1", + name: "Big U", + }, + { + id: "fi2", + }, + ], + }); + await render(); const inputFields = new InputFieldsFromDOM(); @@ -414,9 +419,10 @@ module( }); test("input fields of type float", async function (assert) { - const [schema, data] = schemaAndData(3); + const setting = schemaAndData(3); + await render(); const inputFields = new InputFieldsFromDOM(); @@ -501,9 +507,10 @@ module( }); test("input fields of type category", async function (assert) { - const [schema, data] = schemaAndData(3); + const setting = schemaAndData(3); + await render(); const inputFields = new InputFieldsFromDOM(); @@ -530,9 +537,10 @@ module( }); test("input fields of type tag", async function (assert) { - const [schema, data] = schemaAndData(3); + const setting = schemaAndData(3); + await render(); const inputFields = new InputFieldsFromDOM(); @@ -567,9 +575,10 @@ module( ]); }); - const [schema, data] = schemaAndData(3); + const setting = schemaAndData(3); + await render(); const inputFields = new InputFieldsFromDOM();