mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
DEV: ensures highlightjs is correctly tested (#9923)
This commit is contained in:
22
test/javascripts/components/highlighted-code-test.js
Normal file
22
test/javascripts/components/highlighted-code-test.js
Normal file
@ -0,0 +1,22 @@
|
||||
import componentTest from "helpers/component-test";
|
||||
|
||||
moduleForComponent("highlighted-code", { integration: true });
|
||||
|
||||
componentTest("highlighting code", {
|
||||
template: "{{highlighted-code lang='ruby' code=code}}",
|
||||
|
||||
beforeEach() {
|
||||
Discourse.HighlightJSPath =
|
||||
"assets/highlightjs/highlight-test-bundle.min.js";
|
||||
this.set("code", "def test; end");
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
assert.equal(
|
||||
find("code.ruby.hljs .hljs-function .hljs-keyword")
|
||||
.text()
|
||||
.trim(),
|
||||
"def"
|
||||
);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user