Permalink
Show file tree
Hide file tree
13 changes: 13 additions & 0 deletions
13
app/assets/javascripts/discourse/tests/unit/lib/pretty-text-test.js
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
SECURITY: Handle incomplete quote bbcode (#18311)
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/assets/javascripts/discourse/tests/integration/components/widgets/post-cooked-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { module, test } from "qunit"; | ||
| import { setupRenderingTest } from "discourse/tests/helpers/component-test"; | ||
| import { render } from "@ember/test-helpers"; | ||
| import { query } from "discourse/tests/helpers/qunit-helpers"; | ||
| import { hbs } from "ember-cli-htmlbars"; | ||
|
|
||
| module("Integration | Component | Widget | post-cooked", function (hooks) { | ||
| setupRenderingTest(hooks); | ||
|
|
||
| test("quotes with no username and no valid topic", async function (assert) { | ||
| this.set("args", { | ||
| cooked: `<aside class=\"quote no-group quote-post-not-found\" data-post=\"1\" data-topic=\"123456\">\n<blockquote>\n<p>abcd</p>\n</blockquote>\n</aside>\n<p>Testing the issue</p>`, | ||
| }); | ||
|
|
||
| await render( | ||
| hbs`<MountWidget @widget="post-cooked" @args={{this.args}} />` | ||
| ); | ||
|
|
||
| assert.strictEqual(query("blockquote").innerText, "abcd"); | ||
| }); | ||
| }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters