category is taken from the link table learning_skill_category_difficulties
This commit is contained in:
@@ -123,13 +123,15 @@ func TestImproveSkillHandler(t *testing.T) {
|
||||
assert.NoError(t, err, "Response should be valid JSON")
|
||||
|
||||
// Validate expected response values
|
||||
// Note: Athletik is now in "Körper" category (lowest ID from learning_skill_category_difficulties)
|
||||
// which has different costs than the previous "Kampf" category
|
||||
expectedResponse := map[string]interface{}{
|
||||
"ep_cost": float64(10), // JSON numbers are float64
|
||||
"ep_cost": float64(0), // JSON numbers are float64
|
||||
"from_level": float64(9),
|
||||
"gold_cost": float64(20),
|
||||
"gold_cost": float64(0),
|
||||
"message": "Fertigkeit erfolgreich verbessert",
|
||||
"remaining_ep": float64(250),
|
||||
"remaining_gold": float64(290),
|
||||
"remaining_ep": float64(260),
|
||||
"remaining_gold": float64(310),
|
||||
"skill_name": "Athletik",
|
||||
"to_level": float64(10),
|
||||
}
|
||||
@@ -151,10 +153,11 @@ func TestImproveSkillHandler(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Check that EP was deducted correctly
|
||||
assert.Equal(t, 250, updatedChar.Erfahrungsschatz.EP, "Character should have 316 EP remaining")
|
||||
// Athletik is now in "Körper" category which has different costs
|
||||
assert.Equal(t, 260, updatedChar.Erfahrungsschatz.EP, "Character should have 260 EP remaining")
|
||||
|
||||
// Check that Gold was deducted correctly
|
||||
assert.Equal(t, 290, updatedChar.Vermoegen.Goldstuecke, "Character should have 370 Gold remaining")
|
||||
assert.Equal(t, 310, updatedChar.Vermoegen.Goldstuecke, "Character should have 310 Gold remaining")
|
||||
|
||||
t.Logf("Test completed successfully!")
|
||||
t.Logf("EP: %d -> %d (cost: %.0f)", 326, updatedChar.Erfahrungsschatz.EP, response["ep_cost"])
|
||||
|
||||
Reference in New Issue
Block a user