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"; const CONTENT_DIV_SELECTOR = "li > a > div"; module( "Integration | Component | Widget | quick-access-item", function (hooks) { setupRenderingTest(hooks); test("content attribute is escaped", async function (assert) { this.set("args", { content: "bold" }); await render( hbs`` ); const contentDiv = query(CONTENT_DIV_SELECTOR); assert.strictEqual(contentDiv.innerText, "bold"); }); test("escapedContent attribute is not escaped", async function (assert) { this.set("args", { escapedContent: ""quote"" }); await render( hbs`` ); const contentDiv = query(CONTENT_DIV_SELECTOR); assert.strictEqual(contentDiv.innerText, '"quote"'); }); } );