1
0
mirror of synced 2026-08-05 17:56:58 +00:00
Files

40 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2021-09-28 19:22:08 +04:00
import { visit } from "@ember/test-helpers";
2024-01-16 17:50:43 +01:00
import { test } from "qunit";
2024-12-02 23:13:34 +01:00
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { i18n } from "discourse-i18n";
2021-09-28 19:22:08 +04:00
acceptance(
"Discourse Solved Plugin | activity/solved | empty state",
function (needs) {
needs.user();
needs.pretender((server, helper) => {
2024-12-02 23:13:34 +01:00
server.get("/user_actions.json", () =>
helper.response({ user_actions: [] })
);
2021-09-28 19:22:08 +04:00
});
test("When looking at own activity", async function (assert) {
2024-12-02 23:13:34 +01:00
await visit(`/u/eviltrout/activity/solved`);
2024-12-02 23:13:34 +01:00
assert
.dom("div.empty-state span.empty-state-title")
.hasText(i18n("solved.no_solved_topics_title"));
assert
.dom("div.empty-state div.empty-state-body")
.hasText(i18n("solved.no_solved_topics_body"));
2021-09-28 19:22:08 +04:00
});
test("When looking at another user's activity", async function (assert) {
2024-12-02 23:13:34 +01:00
await visit(`/u/charlie/activity/solved`);
2024-12-02 23:13:34 +01:00
assert.dom("div.empty-state span.empty-state-title").hasText(
i18n("solved.no_solved_topics_title_others", {
username: "charlie",
})
);
2024-12-02 23:13:34 +01:00
assert.dom("div.empty-state div.empty-state-body").hasNoText();
2021-09-28 19:22:08 +04:00
});
}
);