import { setupTest } from "ember-qunit"; import { module, test } from "qunit"; import { cook } from "discourse/lib/text"; module("lib:details-cooked-test", (hooks) => { setupTest(hooks); test("details", async (assert) => { const testCooked = async (input, expected, text) => { const cooked = (await cook(input)).toString(); assert.strictEqual(cooked, expected, text); }; await testCooked( `
Infocoucou
`, `
Infocoucou
`, "manual HTML for details" ); await testCooked( `[details=test'ing all the things]\ntest\n[/details]`, `
\n\ntest'ing all the things\n

test

\n
`, "details with spaces and a single quote" ); await testCooked( `[details=”test'ing all the things”]\ntest\n[/details]`, `
\n\ntest'ing all the things\n

test

\n
`, "details surrounded by finnish double quotes" ); }); });