2019-06-12 05:26:24 -04:00
|
|
|
import selectKit from "helpers/select-kit-helper";
|
2019-06-14 08:54:20 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
2015-04-06 14:14:00 -04:00
|
|
|
|
2019-06-14 08:54:20 -04:00
|
|
|
acceptance("Badges", { loggedIn: true });
|
2014-07-31 18:44:32 -04:00
|
|
|
|
2018-07-19 05:40:42 -04:00
|
|
|
QUnit.test("Visit Badge Pages", async assert => {
|
|
|
|
await visit("/badges");
|
2014-07-31 18:44:32 -04:00
|
|
|
|
2018-07-19 05:40:42 -04:00
|
|
|
assert.ok($("body.badges-page").length, "has body class");
|
|
|
|
assert.ok(exists(".badge-groups .badge-card"), "has a list of badges");
|
|
|
|
|
|
|
|
await visit("/badges/9/autobiographer");
|
|
|
|
|
|
|
|
assert.ok(exists(".badge-card"), "has the badge in the listing");
|
|
|
|
assert.ok(exists(".user-info"), "has the list of users with that badge");
|
|
|
|
assert.ok(!exists(".badge-card:eq(0) script"));
|
2018-06-15 11:03:24 -04:00
|
|
|
});
|
2019-06-12 05:26:24 -04:00
|
|
|
|
|
|
|
QUnit.test("shows correct badge titles to choose from", async assert => {
|
|
|
|
const availableBadgeTitles = selectKit(".select-kit");
|
|
|
|
await visit("/badges/50/custombadge");
|
|
|
|
await availableBadgeTitles.expand();
|
|
|
|
assert.ok(availableBadgeTitles.rowByIndex(1).name() === "CustomBadge");
|
|
|
|
});
|