This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/acceptance/users-test.js
Robin Ward 71d37953d5 REFACTOR: Import QUnit and related helpers rather than globals
We used many global functions to handle tests when they should be
imported like other libraries in our application. This also gets us
closer to the way Ember CLI prefers our tests to be laid out.
2020-10-07 11:50:49 -04:00

27 lines
926 B
JavaScript

import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("User Directory");
test("Visit Page", async (assert) => {
await visit("/u");
assert.ok($("body.users-page").length, "has the body class");
assert.ok(exists(".directory table tr"), "has a list of users");
});
test("Visit All Time", async (assert) => {
await visit("/u?period=all");
assert.ok(exists(".time-read"), "has time read column");
});
test("Visit Without Usernames", async (assert) => {
await visit("/u?exclude_usernames=system");
assert.ok($("body.users-page").length, "has the body class");
assert.ok(exists(".directory table tr"), "has a list of users");
});
test("Visit With Group Filter", async (assert) => {
await visit("/u?group=trust_level_0");
assert.ok($("body.users-page").length, "has the body class");
assert.ok(exists(".directory table tr"), "has a list of users");
});