FIX: New general category changes preventing topic create (#18459)
* FIX: New general category changes preventing topic create Follow up to: #18383 The logic in the previous commit was checking for null, but we are seeding the SiteSetting.general_category_id with an id of -1 so we need to check for a positive value as well as checking for null. See: https://meta.discourse.org/t/240661 * Add js test for presence of category… dropdown option
This commit is contained in:
+17
@@ -143,6 +143,23 @@ module(
|
||||
assert.strictEqual(this.subject.header().label(), "");
|
||||
});
|
||||
|
||||
test("with allowUncategorized=null and generalCategoryId present, but not set", async function (assert) {
|
||||
this.siteSettings.allow_uncategorized_topics = false;
|
||||
this.siteSettings.general_category_id = -1;
|
||||
|
||||
await render(hbs`
|
||||
<CategoryChooser
|
||||
@value={{this.value}}
|
||||
@options={{hash
|
||||
allowUncategorized=null
|
||||
}}
|
||||
/>
|
||||
`);
|
||||
|
||||
assert.strictEqual(this.subject.header().value(), null);
|
||||
assert.strictEqual(this.subject.header().label(), "category…");
|
||||
});
|
||||
|
||||
test("with allowUncategorized=null none=true", async function (assert) {
|
||||
this.siteSettings.allow_uncategorized_topics = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user