Files
b41aa7f69b DEV: Adopt post list component and new posts route front-end (#30604)
Recently we introduced a new `PostList` component (https://github.com/discourse/discourse/commit/06688d36fb3074e9dd9864b77251ea88dff84cef). In this update, we make broader adoption of this component. In particular, these areas include using the new component in the user activity stream pages, user's deleted posts, and pending posts page. This update also takes the existing `posts` route and adds a barebones front-end for it to view posts all in one page.

---------

Co-authored-by: David Taylor <[email protected]>
2025-01-23 10:20:45 -08:00

57 lines
1.7 KiB
JavaScript

import { currentRouteName, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("User Anonymous", function () {
test("Root URL", async function (assert) {
await visit("/u/eviltrout");
assert
.dom(document.body)
.hasClass("user-summary-page", "has the body class");
assert.strictEqual(
currentRouteName(),
"user.summary",
"it defaults to summary"
);
});
test("Filters", async function (assert) {
await visit("/u/eviltrout/activity");
assert
.dom(document.body)
.hasClass("user-activity-page", "has the body class");
assert.dom(".user-main .about").exists("has the about section");
assert.dom(".user-stream-item").exists("has stream items");
await visit("/u/eviltrout/activity/topics");
assert.dom(".user-stream-item").doesNotExist("has no stream displayed");
assert.dom(".topic-list tr").exists("has a topic list");
await visit("/u/eviltrout/activity/replies");
assert.dom(".user-main .about").exists("has the about section");
assert.dom(".user-stream-item").exists("has stream items");
assert.dom(".user-stream.filter-5").exists("stream has filter class");
});
test("Badges", async function (assert) {
await visit("/u/eviltrout/badges");
assert
.dom(document.body)
.hasClass("user-badges-page", "has the body class");
assert.dom(".badge-group-list .badge-card").exists("shows a badge");
});
test("Restricted Routes", async function (assert) {
await visit("/u/eviltrout/preferences");
assert.strictEqual(
currentURL(),
"/u/eviltrout/activity",
"it redirects from preferences"
);
});
});