DEV: Use the block form of module() (#17151)

This commit is contained in:
Jarek Radosz
2022-06-20 15:42:10 +02:00
committed by GitHub
parent 321118f384
commit ba2c7b8f35
4 changed files with 713 additions and 709 deletions

View File

@ -1,8 +1,6 @@
import PrettyText, { buildOptions } from "pretty-text/pretty-text";
import { module, test } from "qunit";
module("lib:details-cooked-test");
const defaultOpts = buildOptions({
siteSettings: {
enable_emoji: true,
@ -14,26 +12,28 @@ const defaultOpts = buildOptions({
getURL: (url) => url,
});
test("details", function (assert) {
const cooked = (input, expected, text) => {
assert.strictEqual(
new PrettyText(defaultOpts).cook(input),
expected.replace(/\/>/g, ">"),
text
module("lib:details-cooked-test", function () {
test("details", function (assert) {
const cooked = (input, expected, text) => {
assert.strictEqual(
new PrettyText(defaultOpts).cook(input),
expected.replace(/\/>/g, ">"),
text
);
};
cooked(
`<details><summary>Info</summary>coucou</details>`,
`<details><summary>Info</summary>coucou</details>`,
"manual HTML for details"
);
};
cooked(
`<details><summary>Info</summary>coucou</details>`,
`<details><summary>Info</summary>coucou</details>`,
"manual HTML for details"
);
cooked(
"[details=testing]\ntest\n[/details]",
`<details>
cooked(
"[details=testing]\ntest\n[/details]",
`<details>
<summary>
testing</summary>
<p>test</p>
</details>`
);
);
});
});