2022-11-02 09:41:30 -04:00
|
|
|
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
|
2022-12-22 08:35:18 -05:00
|
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
2022-11-02 09:41:30 -04:00
|
|
|
import hbs from "htmlbars-inline-precompile";
|
|
|
|
import I18n from "I18n";
|
2022-12-22 08:35:18 -05:00
|
|
|
import { module, test } from "qunit";
|
|
|
|
import { render } from "@ember/test-helpers";
|
2022-11-02 09:41:30 -04:00
|
|
|
|
|
|
|
module(
|
|
|
|
"Discourse Chat | Component | chat-retention-reminder",
|
|
|
|
function (hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
2023-02-15 08:50:01 -05:00
|
|
|
test("display retention info", async function (assert) {
|
|
|
|
this.channel = ChatChannel.create({ chatable_type: "Category" });
|
2022-12-22 08:35:18 -05:00
|
|
|
this.currentUser.set("needs_channel_retention_reminder", true);
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2023-03-03 07:09:25 -05:00
|
|
|
await render(hbs`<ChatRetentionReminder @channel={{this.channel}} />`);
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2023-02-15 08:50:01 -05:00
|
|
|
assert.dom(".chat-retention-reminder").includesText(
|
|
|
|
I18n.t("chat.retention_reminders.public", {
|
|
|
|
count: this.siteSettings.chat_channel_retention_days,
|
|
|
|
})
|
2022-12-22 08:35:18 -05:00
|
|
|
);
|
2022-11-02 09:41:30 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|