mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Use the block form of module()
(#17151)
This commit is contained in:
@ -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>`
|
||||
);
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user