mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:13:39 +08:00
parent
36e53db300
commit
621b6493f7
|
@ -1,4 +1,5 @@
|
|||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import selectKit from "helpers/select-kit-helper";
|
||||
import { acceptance, logIn } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Badges");
|
||||
|
||||
|
@ -14,3 +15,13 @@ QUnit.test("Visit Badge Pages", async assert => {
|
|||
assert.ok(exists(".user-info"), "has the list of users with that badge");
|
||||
assert.ok(!exists(".badge-card:eq(0) script"));
|
||||
});
|
||||
|
||||
QUnit.test("shows correct badge titles to choose from", async assert => {
|
||||
logIn();
|
||||
Discourse.reset();
|
||||
const availableBadgeTitles = selectKit(".select-kit");
|
||||
|
||||
await visit("/badges/50/custombadge");
|
||||
await availableBadgeTitles.expand();
|
||||
assert.ok(availableBadgeTitles.rowByIndex(1).name() === "CustomBadge");
|
||||
});
|
||||
|
|
|
@ -404,6 +404,30 @@ export default {
|
|||
badge_type_id: 3
|
||||
}
|
||||
},
|
||||
"/badges/50": {
|
||||
badge_types: [
|
||||
{
|
||||
id: 3,
|
||||
name: "Bronze"
|
||||
}
|
||||
],
|
||||
badge: {
|
||||
id: 50,
|
||||
name: "CustomBadge",
|
||||
description: null,
|
||||
long_description: "",
|
||||
grant_count: 10,
|
||||
allow_title: true,
|
||||
multiple_grant: true,
|
||||
icon: "fa-certificate",
|
||||
listable: true,
|
||||
enabled: true,
|
||||
badge_grouping_id: 1,
|
||||
system: false,
|
||||
badge_type_id: 3,
|
||||
has_badge: true
|
||||
}
|
||||
},
|
||||
"/user_badges.json": {
|
||||
badges: [
|
||||
{
|
||||
|
|
|
@ -36,6 +36,13 @@ export default {
|
|||
name: "Badge 8",
|
||||
description: null,
|
||||
badge_type_id: 13
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
name: "CustomBadge",
|
||||
description: null,
|
||||
allow_title: true,
|
||||
badge_type_id: 3
|
||||
}
|
||||
],
|
||||
badge_types: [
|
||||
|
@ -51,6 +58,12 @@ export default {
|
|||
granted_at: "2014-03-09T20:30:01.420-04:00",
|
||||
badge_id: 880,
|
||||
granted_by_id: null
|
||||
},
|
||||
{
|
||||
id: 669,
|
||||
granted_at: "2014-03-09T20:30:01.420-04:00",
|
||||
badge_id: 50,
|
||||
granted_by_id: null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user