style: apply biome lint fixes to catalog files and live repair tests
This commit is contained in:
1 parent
3e69b72513
commit
acbe54fcb7
5 files changed
+23
-21
No files matched your search
@@ -1,6 +1,10 @@
|
||||
import { z } from "zod";
|
||||
import { CatalogInputError } from "./hierarchy";
|
||||
import { EMULATOR_POINTS_TYPES, offerIdSchema, offerInteger } from "./offer-input";
|
||||
import {
|
||||
EMULATOR_POINTS_TYPES,
|
||||
offerIdSchema,
|
||||
offerInteger,
|
||||
} from "./offer-input";
|
||||
|
||||
const priceChange = z
|
||||
.object({
|
||||
@@ -27,7 +31,9 @@ export const bulkOfferChangesSchema = z
|
||||
.refine(
|
||||
(v) =>
|
||||
v.pointsType === undefined ||
|
||||
EMULATOR_POINTS_TYPES.includes(v.pointsType as (typeof EMULATOR_POINTS_TYPES)[number]),
|
||||
EMULATOR_POINTS_TYPES.includes(
|
||||
v.pointsType as (typeof EMULATOR_POINTS_TYPES)[number],
|
||||
),
|
||||
"Points type is not supported by the emulator",
|
||||
);
|
||||
export const bulkOfferInputSchema = z
|
||||
|
||||
@@ -70,12 +70,8 @@ describe("emulator offer constraints", () => {
|
||||
expect(offerPatchSchema.parse({ amount: 1 })).toEqual({ amount: 1 });
|
||||
});
|
||||
it("rejects unsupported pointsType values", () => {
|
||||
expect(offerPatchSchema.safeParse({ pointsType: 101 }).success).toBe(
|
||||
false,
|
||||
);
|
||||
expect(offerPatchSchema.safeParse({ pointsType: 103 }).success).toBe(
|
||||
false,
|
||||
);
|
||||
expect(offerPatchSchema.safeParse({ pointsType: 101 }).success).toBe(false);
|
||||
expect(offerPatchSchema.safeParse({ pointsType: 103 }).success).toBe(false);
|
||||
expect(offerPatchSchema.safeParse({ pointsType: -1 }).success).toBe(false);
|
||||
});
|
||||
it("accepts supported pointsType values", () => {
|
||||
@@ -88,12 +84,10 @@ describe("emulator offer constraints", () => {
|
||||
});
|
||||
it("rejects limitedStack below limitedSells", () => {
|
||||
expect(
|
||||
offerPatchSchema.safeParse({ limitedStack: 0, limitedSells: 1 })
|
||||
.success,
|
||||
offerPatchSchema.safeParse({ limitedStack: 0, limitedSells: 1 }).success,
|
||||
).toBe(false);
|
||||
expect(
|
||||
offerPatchSchema.safeParse({ limitedStack: 5, limitedSells: 10 })
|
||||
.success,
|
||||
offerPatchSchema.safeParse({ limitedStack: 5, limitedSells: 10 }).success,
|
||||
).toBe(false);
|
||||
});
|
||||
it("accepts limitedStack >= limitedSells", () => {
|
||||
|
||||
@@ -52,7 +52,9 @@ export const offerPatchSchema = z
|
||||
.refine(
|
||||
(data) =>
|
||||
data.pointsType === undefined ||
|
||||
EMULATOR_POINTS_TYPES.includes(data.pointsType as (typeof EMULATOR_POINTS_TYPES)[number]),
|
||||
EMULATOR_POINTS_TYPES.includes(
|
||||
data.pointsType as (typeof EMULATOR_POINTS_TYPES)[number],
|
||||
),
|
||||
"Points type is not supported by the emulator",
|
||||
)
|
||||
.refine(
|
||||
|
||||
Reference in new issue
Block a user