mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 23:52:59 +08:00
This was required in older versions of Ember. But now, bare template tags can access `this.`. This commit was created by upgrading lint-configs, and then running `pnpm lint:js:fix && pnpm lint:prettier:fix` Rule development: https://github.com/discourse/lint-configs/pull/154
33 lines
1.1 KiB
Text
Vendored
33 lines
1.1 KiB
Text
Vendored
import { hash } from "@ember/helper";
|
|
import { getOwner } from "@ember/owner";
|
|
import { render } from "@ember/test-helpers";
|
|
import { module, test } from "qunit";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import ArchiveChannel from "discourse/plugins/chat/discourse/components/chat/modal/archive-channel";
|
|
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
|
|
|
module(
|
|
"Discourse Chat | Component | <Chat::Modal::ArchiveChannel>",
|
|
function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("channel title is escaped in instructions correctly", async function (assert) {
|
|
this.channel = new ChatFabricators(getOwner(this)).channel({
|
|
title: `<script>someeviltitle</script>`,
|
|
});
|
|
|
|
await render(
|
|
<template>
|
|
<ArchiveChannel
|
|
@inline={{true}}
|
|
@model={{hash channel=this.channel}}
|
|
/>
|
|
</template>
|
|
);
|
|
|
|
assert
|
|
.dom(".chat-modal-archive-channel")
|
|
.includesHtml("<script>someeviltitle</script>");
|
|
});
|
|
}
|
|
);
|