mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FIX: Sanitize tags before creation
This commit is contained in:
@ -12,6 +12,7 @@ componentTest("default", {
|
||||
|
||||
beforeEach() {
|
||||
this.siteSettings.max_tag_length = 24;
|
||||
this.siteSettings.force_lowercase_tags = true;
|
||||
|
||||
this.site.set("can_create_tag", true);
|
||||
this.set("tags", ["jeff", "neil", "arpit"]);
|
||||
@ -85,11 +86,11 @@ componentTest("default", {
|
||||
);
|
||||
|
||||
await this.get("subject").expand();
|
||||
await this.get("subject").fillInFilter("invalid'tag");
|
||||
await this.get("subject").fillInFilter("invalid' Tag");
|
||||
await this.get("subject").keyboard("enter");
|
||||
assert.deepEqual(
|
||||
this.get("tags"),
|
||||
["jeff", "neil", "arpit", "régis", "joffrey", "invalidtag"],
|
||||
["jeff", "neil", "arpit", "régis", "joffrey", "invalid-tag"],
|
||||
"it strips invalid characters in tag"
|
||||
);
|
||||
|
||||
@ -98,7 +99,7 @@ componentTest("default", {
|
||||
await this.get("subject").keyboard("enter");
|
||||
assert.deepEqual(
|
||||
this.get("tags"),
|
||||
["jeff", "neil", "arpit", "régis", "joffrey", "invalidtag"],
|
||||
["jeff", "neil", "arpit", "régis", "joffrey", "invalid-tag"],
|
||||
"it does not allow creating long tags"
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user