mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 00:54:57 +08:00
ec2a66d1f0
https://meta.discourse.org/t/custom-user-fields-show-on-activity-but-not-summary-page/59196/3?u=techapj
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
import { acceptance } from "helpers/qunit-helpers";
|
|
acceptance("User Anonymous");
|
|
|
|
export function hasStream() {
|
|
andThen(() => {
|
|
ok(exists('.user-main .about'), 'it has the about section');
|
|
ok(count('.user-stream .item') > 0, 'it has stream items');
|
|
});
|
|
}
|
|
|
|
function hasTopicList() {
|
|
andThen(() => {
|
|
equal(count('.user-stream .item'), 0, "has no stream displayed");
|
|
ok(count('.topic-list tr') > 0, 'it has a topic list');
|
|
});
|
|
}
|
|
|
|
test("Root URL", () => {
|
|
visit("/users/eviltrout");
|
|
andThen(() => {
|
|
ok($('body.user-summary-page').length, "has the body class");
|
|
equal(currentPath(), 'user.summary', "it defaults to summary");
|
|
});
|
|
});
|
|
|
|
test("Filters", () => {
|
|
visit("/users/eviltrout/activity");
|
|
andThen(() => {
|
|
ok($('body.user-activity-page').length, "has the body class");
|
|
});
|
|
hasStream();
|
|
|
|
visit("/users/eviltrout/activity/topics");
|
|
hasTopicList();
|
|
|
|
visit("/users/eviltrout/activity/replies");
|
|
hasStream();
|
|
});
|
|
|
|
test("Badges", () => {
|
|
visit("/users/eviltrout/badges");
|
|
andThen(() => {
|
|
ok($('body.user-badges-page').length, "has the body class");
|
|
ok(exists(".user-badges-list .badge-card"), "shows a badge");
|
|
});
|
|
});
|
|
|
|
test("Restricted Routes", () => {
|
|
visit("/users/eviltrout/preferences");
|
|
|
|
andThen(() => {
|
|
equal(currentURL(), '/users/eviltrout/activity', "it redirects from preferences");
|
|
});
|
|
});
|