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";
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) => {
server.get("/solution/by_user.json", () =>
helper.response({ user_solved_posts: [] })
2024-12-02 23:13:34 +01:00
);
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(".empty-state .empty-state__title")
2024-12-02 23:13:34 +01:00
.hasText(i18n("solved.no_solved_topics_title"));
assert
.dom(".empty-state .empty-state__body")
2024-12-02 23:13:34 +01:00
.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`);
assert.dom(".empty-state .empty-state__title").hasText(
2024-12-02 23:13:34 +01:00
i18n("solved.no_solved_topics_title_others", {
username: "charlie",
})
);
assert.dom(".empty-state .empty-state__body").doesNotExist();
2021-09-28 19:22:08 +04:00
});
}
);