FIX: Ensure form_template_ids is defined on new category records (#20610)

Navigating to the topic template tab on a new category form resulted in
exceptions because the `form_template_ids` property was undefined.

This fix sets the `form_template_ids` property on new category records.
This commit is contained in:
Selase Krakani 2023-03-09 23:34:08 +00:00 committed by GitHub
parent 2d0ad48dd1
commit 0603bd57df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,7 @@ export default DiscourseRoute.extend({
custom_fields: {}, custom_fields: {},
search_priority: SEARCH_PRIORITIES.normal, search_priority: SEARCH_PRIORITIES.normal,
required_tag_groups: [], required_tag_groups: [],
form_template_ids: [],
}); });
}, },

View File

@ -22,6 +22,11 @@ acceptance("Category New", function (needs) {
await fillIn("input.category-name", "testing"); await fillIn("input.category-name", "testing");
assert.strictEqual(query(".badge-category").innerText, "testing"); assert.strictEqual(query(".badge-category").innerText, "testing");
await click(".edit-category-nav .edit-category-topic-template a");
assert
.dom(".edit-category-tab-topic-template")
.isVisible("it can switch to topic template tab");
await click(".edit-category-nav .edit-category-tags a"); await click(".edit-category-nav .edit-category-tags a");
await click("button.add-required-tag-group"); await click("button.add-required-tag-group");