Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/src/skins/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
_HANDHELD_BASES = frozenset(
{
"swords",
"lutes",
"battleaxes",
"daggers",
"warhammers",
Expand Down
24 changes: 24 additions & 0 deletions backend/src/skins/test_base_sets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Base-set allowlists for skin kinds."""

from __future__ import annotations

import unittest

from skins.submissions import _validate_base_set


class LuteBaseSetTest(unittest.TestCase):
def test_lutes_allowed_for_handheld_and_item_3d(self) -> None:
self.assertEqual(_validate_base_set("handheld", "lutes"), "lutes")
self.assertEqual(_validate_base_set("item_3d", "lutes"), "lutes")

def test_lutes_rejected_for_large_handheld(self) -> None:
# skins.submissions and src.skins.submissions are both on the path, so
# the raised class is not always the imported one.
with self.assertRaises(Exception) as ctx:
_validate_base_set("large_handheld", "lutes")
self.assertIn("not valid for kind 'large_handheld'", str(ctx.exception))


if __name__ == "__main__":
unittest.main()
14 changes: 14 additions & 0 deletions frontend/lib/skins/baseSets.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { describe, expect, it } from "vitest";
import { baseSetLabel, baseSetsForKind } from "./baseSets";

describe("lute base set", () => {
it("offers Lutes for 16×16 handheld and item 3D", () => {
expect(baseSetsForKind("handheld")).toContain("lutes");
expect(baseSetsForKind("item_3d")).toContain("lutes");
expect(baseSetLabel("lutes")).toBe("Lutes");
});

it("keeps Lutes off large handheld", () => {
expect(baseSetsForKind("large_handheld")).not.toContain("lutes");
});
});
2 changes: 2 additions & 0 deletions frontend/lib/skins/baseSets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const MAX_ARMOR_TIERS = ARMOR_TIERS.length;

const HANDHELD = [
"swords",
"lutes",
"battleaxes",
"daggers",
"warhammers",
Expand Down Expand Up @@ -54,6 +55,7 @@ const LABELS: Record<string, string> = {
mage: "Mage",
infantry: "Infantry",
swords: "Swords",
lutes: "Lutes",
battleaxes: "Battleaxes",
daggers: "Daggers",
warhammers: "Warhammers",
Expand Down