2015-04-21 14:36:46 -04:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-08-02 13:21:06 -04:00
|
|
|
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(() => {
|
|
|
|
equal(currentPath(), 'user.userActivity.index', "it defaults to activity");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
test("Filters", () => {
|
|
|
|
visit("/users/eviltrout/activity");
|
2016-11-10 13:33:31 -05:00
|
|
|
andThen(() => {
|
|
|
|
ok($('body.user-activity-page').length, "has the body class");
|
|
|
|
});
|
2016-08-02 13:21:06 -04:00
|
|
|
hasStream();
|
|
|
|
|
|
|
|
visit("/users/eviltrout/activity/topics");
|
|
|
|
hasTopicList();
|
|
|
|
|
|
|
|
visit("/users/eviltrout/activity/replies");
|
|
|
|
hasStream();
|
|
|
|
});
|
|
|
|
|
2016-11-10 13:33:31 -05:00
|
|
|
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");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-08-02 13:21:06 -04:00
|
|
|
test("Restricted Routes", () => {
|
|
|
|
visit("/users/eviltrout/preferences");
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
equal(currentURL(), '/users/eviltrout/activity', "it redirects from preferences");
|
|
|
|
});
|
|
|
|
});
|