DEV: ensures highlightjs is correctly tested (#9923)

This commit is contained in:
Joffrey JAFFEUX
2020-05-29 13:05:44 +02:00
committed by GitHub
parent 5d792483f0
commit 7635c18a14
3 changed files with 221 additions and 0 deletions

View 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"
);
}
});