mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: allows forcing unsafe string in select-kit (#6386)
forceEscape will be defaulted to true before next release.
This commit is contained in:
parent
2cc48cfd06
commit
38668818a5
16 changed files with 192 additions and 21 deletions
|
@ -771,3 +771,67 @@ componentTest("with no content and allowAny", {
|
|||
assert.ok(!$filter.hasClass("is-hidden"));
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("with forceEscape", {
|
||||
template: "{{single-select content=content forceEscape=true}}",
|
||||
|
||||
beforeEach() {
|
||||
this.set("content", ["<div>sam</div>"]);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
await this.get("subject").expand();
|
||||
|
||||
const row = this.get("subject").rowByIndex(0);
|
||||
assert.equal(
|
||||
row
|
||||
.el()
|
||||
.find(".name")
|
||||
.html()
|
||||
.trim(),
|
||||
"<div>sam</div>"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.el()
|
||||
.find(".selected-name")
|
||||
.html()
|
||||
.trim(),
|
||||
"<div>sam</div>"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("without forceEscape", {
|
||||
template: "{{single-select content=content forceEscape=false}}",
|
||||
|
||||
beforeEach() {
|
||||
this.set("content", ["<div>sam</div>"]);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
await this.get("subject").expand();
|
||||
|
||||
const row = this.get("subject").rowByIndex(0);
|
||||
assert.equal(
|
||||
row
|
||||
.el()
|
||||
.find(".name")
|
||||
.html()
|
||||
.trim(),
|
||||
"<div>sam</div>"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
this.get("subject")
|
||||
.header()
|
||||
.el()
|
||||
.find(".selected-name")
|
||||
.html()
|
||||
.trim(),
|
||||
"<div>sam</div>"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue