mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:14:12 +08:00
Retry: Rename all test files from JS -> ES6
This commit is contained in:
31
test/javascripts/widgets/quick-access-item-test.js
Normal file
31
test/javascripts/widgets/quick-access-item-test.js
Normal file
@ -0,0 +1,31 @@
|
||||
import { moduleForWidget, widgetTest } from "helpers/widget-test";
|
||||
|
||||
moduleForWidget("quick-access-item");
|
||||
|
||||
const CONTENT_DIV_SELECTOR = "li > a > div";
|
||||
|
||||
widgetTest("content attribute is escaped", {
|
||||
template: '{{mount-widget widget="quick-access-item" args=args}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("args", { content: "<b>bold</b>" });
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
const contentDiv = find(CONTENT_DIV_SELECTOR)[0];
|
||||
assert.equal(contentDiv.innerText, "<b>bold</b>");
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("escapedContent attribute is not escaped", {
|
||||
template: '{{mount-widget widget="quick-access-item" args=args}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set("args", { escapedContent: ""quote"" });
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
const contentDiv = find(CONTENT_DIV_SELECTOR)[0];
|
||||
assert.equal(contentDiv.innerText, '"quote"');
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user