mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import { visit } from "@ember/test-helpers";
|
|
import { test } from "qunit";
|
|
import { i18n } from "discourse-i18n";
|
|
import { acceptance } from "../helpers/qunit-helpers";
|
|
|
|
acceptance("User Activity / Replies - empty state", function (needs) {
|
|
const currentUser = "eviltrout";
|
|
const anotherUser = "charlie";
|
|
|
|
needs.user();
|
|
|
|
needs.pretender((server, helper) => {
|
|
const emptyResponse = { user_actions: [] };
|
|
|
|
server.get("/user_actions.json", () => {
|
|
return helper.response(emptyResponse);
|
|
});
|
|
});
|
|
|
|
test("When looking at own replies page", async function (assert) {
|
|
await visit(`/u/${currentUser}/activity/replies`);
|
|
assert
|
|
.dom("div.empty-state span.empty-state-title")
|
|
.hasText(i18n("user_activity.no_replies_title"));
|
|
});
|
|
|
|
test("When looking at another user's replies page", async function (assert) {
|
|
await visit(`/u/${anotherUser}/activity/replies`);
|
|
assert
|
|
.dom("div.empty-state span.empty-state-title")
|
|
.hasText(
|
|
i18n("user_activity.no_replies_title_others", { username: anotherUser })
|
|
);
|
|
});
|
|
});
|