mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
fix(gacha): add items to reward pool test entries
GetRewardPool now requires entries to have items (EXISTS clause from
2365b63), but the ordering test created entries without items.
This commit is contained in:
@@ -104,12 +104,16 @@ func TestRepoGachaGetRewardPoolOrdering(t *testing.T) {
|
|||||||
repo, db, _ := setupGachaRepo(t)
|
repo, db, _ := setupGachaRepo(t)
|
||||||
|
|
||||||
shopID := CreateTestGachaShop(t, db, "Pool Test", 1)
|
shopID := CreateTestGachaShop(t, db, "Pool Test", 1)
|
||||||
// entry_type=100 is the reward pool
|
// entry_type=100 is the reward pool; each entry needs at least one item
|
||||||
CreateTestGachaEntry(t, db, shopID, 100, 50)
|
e1 := CreateTestGachaEntry(t, db, shopID, 100, 50)
|
||||||
CreateTestGachaEntry(t, db, shopID, 100, 200)
|
CreateTestGachaItem(t, db, e1, 1, 100, 1)
|
||||||
CreateTestGachaEntry(t, db, shopID, 100, 100)
|
e2 := CreateTestGachaEntry(t, db, shopID, 100, 200)
|
||||||
|
CreateTestGachaItem(t, db, e2, 1, 101, 1)
|
||||||
|
e3 := CreateTestGachaEntry(t, db, shopID, 100, 100)
|
||||||
|
CreateTestGachaItem(t, db, e3, 1, 102, 1)
|
||||||
// entry_type=5 should NOT appear in reward pool
|
// entry_type=5 should NOT appear in reward pool
|
||||||
CreateTestGachaEntry(t, db, shopID, 5, 999)
|
e4 := CreateTestGachaEntry(t, db, shopID, 5, 999)
|
||||||
|
CreateTestGachaItem(t, db, e4, 1, 103, 1)
|
||||||
|
|
||||||
entries, err := repo.GetRewardPool(shopID)
|
entries, err := repo.GetRewardPool(shopID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user