mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 12:03:39 +08:00
075af7ba84
- Moves logic into one specialised component - Adds more tests - Removes duplicate key - Uses pluralization - Handles 0 case properly Co-authored-by: Gerhard Schlager <mail@gerhard-schlager.at>
26 lines
857 B
JavaScript
26 lines
857 B
JavaScript
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import hbs from "htmlbars-inline-precompile";
|
|
import I18n from "I18n";
|
|
import { module, test } from "qunit";
|
|
import { render } from "@ember/test-helpers";
|
|
|
|
module(
|
|
"Discourse Chat | Component | chat-channel-settings-view",
|
|
function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("display retention info", async function (assert) {
|
|
this.set("channel", ChatChannel.create({ chatable_type: "Category" }));
|
|
|
|
await render(hbs`<ChatChannelSettingsView @channel={{this.channel}} />`);
|
|
|
|
assert.dom(".chat-retention-info").hasText(
|
|
I18n.t("chat.retention_reminders.public", {
|
|
count: this.siteSettings.chat_channel_retention_days,
|
|
})
|
|
);
|
|
});
|
|
}
|
|
);
|