feat : no longer limit stats choosing
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
import {
|
||||
recommendedStatElement,
|
||||
recommendedStatIconName,
|
||||
recommendedStatOptionConflicts,
|
||||
targetStatIconName,
|
||||
} from "@/lib/guides/stats";
|
||||
|
||||
@@ -84,10 +85,9 @@ describe("structured guide validation", () => {
|
||||
expect(constellationSectionSchema.safeParse({ expectedVersion: 1, note: "x".repeat(2_001), groups: [] }).success).toBe(false);
|
||||
});
|
||||
|
||||
it("limits artifact main stats to three per slot", () => {
|
||||
it("allows every artifact main stat option to be selected", () => {
|
||||
const base = { expectedVersion: 1, groups: artifactGroups, goblet: [], circlet: [], substats: [], targetGroups: [], talents: [], note: null };
|
||||
expect(artifactSectionSchema.safeParse({ ...base, sands: ["EM", "ER", "ATK%"] }).success).toBe(true);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, sands: ["EM", "ER", "ATK%", "HP%"] }).success).toBe(false);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, sands: ["EM", "ER", "ATK%", "HP%", "DEF%"] }).success).toBe(true);
|
||||
});
|
||||
|
||||
it("validates recommended stat conditions independently and preserves their order", () => {
|
||||
@@ -97,7 +97,7 @@ describe("structured guide validation", () => {
|
||||
const result = artifactSectionSchema.parse({ ...base, recommendedGroups: [first, second] });
|
||||
expect(result.recommendedGroups?.map((group) => group.name)).toEqual(["DPS", null]);
|
||||
expect(result.recommendedGroups?.[1].sands).toEqual(["ER"]);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, recommendedGroups: [{ ...first, sands: ["EM", "ER", "ATK%", "HP%"] }] }).success).toBe(false);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, recommendedGroups: [{ ...first, sands: ["EM", "ER", "ATK%", "HP%", "DEF%"] }] }).success).toBe(true);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, recommendedGroups: [{ ...first, goblet: ["invalid"] }] }).success).toBe(false);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, recommendedGroups: [] }).success).toBe(false);
|
||||
expect(artifactSectionSchema.safeParse({ ...base, recommendedGroups: Array(21).fill(first) }).success).toBe(false);
|
||||
@@ -115,6 +115,16 @@ describe("structured guide validation", () => {
|
||||
expect(targetStatIconName("DEF")).toBe("def");
|
||||
});
|
||||
|
||||
it("supports separate CRIT choices and keeps them mutually exclusive with the combined choice", () => {
|
||||
const base = { expectedVersion: 1, groups: artifactGroups, sands: [], goblet: [], targetGroups: [], talents: [], note: null };
|
||||
expect(artifactSectionSchema.safeParse({ ...base, circlet: ["CRIT Rate%", "CRIT DMG%"], substats: ["CRIT Rate%", "CRIT DMG%"] }).success).toBe(true);
|
||||
expect(recommendedStatIconName("CRIT Rate%")).toBe("critrate");
|
||||
expect(recommendedStatIconName("CRIT DMG%")).toBe("critdmg");
|
||||
expect(recommendedStatOptionConflicts("CRIT Rate%/CRIT DMG%", ["CRIT Rate%"])).toBe(true);
|
||||
expect(recommendedStatOptionConflicts("CRIT Rate%", ["CRIT Rate%/CRIT DMG%"])).toBe(true);
|
||||
expect(recommendedStatOptionConflicts("CRIT DMG%", ["CRIT Rate%"])).toBe(false);
|
||||
});
|
||||
|
||||
it("maps elemental damage recommendations to Lunaris element icons", () => {
|
||||
expect(recommendedStatElement("Pyro DMG%")).toBe("Pyro");
|
||||
expect(recommendedStatElement("Hydro DMG%")).toBe("Hydro");
|
||||
|
||||
Reference in New Issue
Block a user