Fix Rust formatting
Server integrations / Paper and protocol tests (push) Failing after 20s
Server integrations / fabric / 1.20.1 (push) Failing after 11s
Server integrations / fabric / 1.21.1 (push) Failing after 14s
Server integrations / fabric / 26.1.2 (push) Failing after 17s
Server integrations / fabric / 26.2 (push) Failing after 12s
Server integrations / fabric / 26.3 (push) Failing after 6s
Server integrations / forge / 1.20.1 (push) Failing after 6s
Server integrations / forge / 1.21.1 (push) Failing after 8s
Server integrations / forge / 26.1.2 (push) Failing after 8s
Server integrations / forge / 26.2 (push) Failing after 8s
Server integrations / forge / 26.3 (push) Failing after 7s
CI / Web UIs (type-check + build) (panel/web) (push) Canceled after 0s
CI / Launcher (Windows build check) (push) Canceled after 2m53s
CI / Real installs (Mojang, Fabric, Quilt, Forge, NeoForge) (push) Canceled after 0s
CI / Docker image builds (push) Canceled after 0s
CI / Rust (fmt, clippy, tests) (push) Canceled after 1m22s
CI / Web UIs (type-check + build) (launcher) (push) Canceled after 1m27s
Server integrations / Paper and protocol tests (push) Failing after 20s
Server integrations / fabric / 1.20.1 (push) Failing after 11s
Server integrations / fabric / 1.21.1 (push) Failing after 14s
Server integrations / fabric / 26.1.2 (push) Failing after 17s
Server integrations / fabric / 26.2 (push) Failing after 12s
Server integrations / fabric / 26.3 (push) Failing after 6s
Server integrations / forge / 1.20.1 (push) Failing after 6s
Server integrations / forge / 1.21.1 (push) Failing after 8s
Server integrations / forge / 26.1.2 (push) Failing after 8s
Server integrations / forge / 26.2 (push) Failing after 8s
Server integrations / forge / 26.3 (push) Failing after 7s
CI / Web UIs (type-check + build) (panel/web) (push) Canceled after 0s
CI / Launcher (Windows build check) (push) Canceled after 2m53s
CI / Real installs (Mojang, Fabric, Quilt, Forge, NeoForge) (push) Canceled after 0s
CI / Docker image builds (push) Canceled after 0s
CI / Rust (fmt, clippy, tests) (push) Canceled after 1m22s
CI / Web UIs (type-check + build) (launcher) (push) Canceled after 1m27s
This commit is contained in:
1 parent
ce49447b6e
commit
60edc99780
58 files changed
+3533
-1375
No files matched your search
@@ -15,14 +15,28 @@ async fn renaming_a_rank_title_reaches_players() {
|
||||
.bind(sid).bind(&uuid).execute(&t.db).await.unwrap();
|
||||
sqlx::query("INSERT INTO user_levels (uuid, global_xp, global_level, updated_at) VALUES (?, 100000, 10, 'now') ON CONFLICT(uuid) DO UPDATE SET global_xp = 100000").bind(&uuid).execute(&t.db).await.unwrap();
|
||||
|
||||
let (s, made) = t.call("POST", "/api/admin/rewards", Some(&admin), Some(json!({"level_type":"server","server_id":sid,"level_req":2,"reward_type":"title","reward_name":"Squire"}))).await;
|
||||
let (s, made) = t
|
||||
.call(
|
||||
"POST",
|
||||
"/api/admin/rewards",
|
||||
Some(&admin),
|
||||
Some(json!({"level_type":"server","server_id":sid,"level_req":2,"reward_type":"title","reward_name":"Squire"})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(s, StatusCode::OK, "{made}");
|
||||
let id = made["id"].as_i64().unwrap();
|
||||
let rank = |v: &Value| v["server_levels"][0]["rank_name"].clone();
|
||||
let (_, levels) = t.call("GET", &format!("/api/v1/levels/player/{uuid}"), Some(&steve), None).await;
|
||||
assert_eq!(rank(&levels), "Squire", "{levels}");
|
||||
|
||||
let (s, r) = t.call("PUT", &format!("/api/admin/rewards/{id}"), Some(&admin), Some(json!({"level_type":"server","server_id":sid,"level_req":2,"reward_type":"title","reward_name":"Knight"}))).await;
|
||||
let (s, r) = t
|
||||
.call(
|
||||
"PUT",
|
||||
&format!("/api/admin/rewards/{id}"),
|
||||
Some(&admin),
|
||||
Some(json!({"level_type":"server","server_id":sid,"level_req":2,"reward_type":"title","reward_name":"Knight"})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(s, StatusCode::OK, "{r}");
|
||||
let (_, levels) = t.call("GET", &format!("/api/v1/levels/player/{uuid}"), Some(&steve), None).await;
|
||||
assert_eq!(rank(&levels), "Knight", "a renamed rank shows up straight away");
|
||||
@@ -40,11 +54,24 @@ async fn renaming_a_global_title_reaches_the_profile_and_reward_list() {
|
||||
let steve = t.login("Steve", "password123").await;
|
||||
let uuid = t.uuid("Steve").await;
|
||||
sqlx::query("INSERT INTO user_levels (uuid, global_xp, global_level, updated_at) VALUES (?, 100000, 10, 'now') ON CONFLICT(uuid) DO UPDATE SET global_xp = 100000").bind(&uuid).execute(&t.db).await.unwrap();
|
||||
let (_, made) = t.call("POST", "/api/admin/levels/rewards", Some(&admin), Some(json!({"level": 100, "reward_type": "title", "reward_value": "Explorer"}))).await;
|
||||
let (_, made) = t
|
||||
.call(
|
||||
"POST",
|
||||
"/api/admin/levels/rewards",
|
||||
Some(&admin),
|
||||
Some(json!({"level": 100, "reward_type": "title", "reward_value": "Explorer"})),
|
||||
)
|
||||
.await;
|
||||
let id = made["id"].as_i64().unwrap();
|
||||
let (_, me) = t.call("GET", "/api/v1/levels/me", Some(&steve), None).await;
|
||||
assert_eq!(me["title"], "Explorer", "{me}");
|
||||
t.call("PUT", &format!("/api/admin/levels/rewards/{id}"), Some(&admin), Some(json!({"level": 100, "reward_type": "title", "reward_value": "Pathfinder"}))).await;
|
||||
t.call(
|
||||
"PUT",
|
||||
&format!("/api/admin/levels/rewards/{id}"),
|
||||
Some(&admin),
|
||||
Some(json!({"level": 100, "reward_type": "title", "reward_value": "Pathfinder"})),
|
||||
)
|
||||
.await;
|
||||
let (_, me) = t.call("GET", "/api/v1/levels/me", Some(&steve), None).await;
|
||||
assert_eq!(me["title"], "Pathfinder", "{me}");
|
||||
let rewards = me["rewards"].to_string();
|
||||
|
||||
Reference in new issue
Block a user