style(types): biome format media-schemas.test.ts

This commit is contained in:
noelorin 2026-09-26 22:47:07 +08:00
parent 9ef9dd01a5
commit cb770d1e56
1 changed files with 4 additions and 10 deletions

View File

@ -54,12 +54,9 @@ describe("danmakuSchemas.settings", () => {
}); });
it("blockTypes 只接受 scroll|top|bottom", () => { it("blockTypes 只接受 scroll|top|bottom", () => {
expect( expect(
danmakuSchemas.settings.safeParse({ blockTypes: ["scroll", "top", "bottom"] }) danmakuSchemas.settings.safeParse({ blockTypes: ["scroll", "top", "bottom"] }).success,
.success,
).toBe(true); ).toBe(true);
expect(danmakuSchemas.settings.safeParse({ blockTypes: ["reverse"] }).success).toBe( expect(danmakuSchemas.settings.safeParse({ blockTypes: ["reverse"] }).success).toBe(false);
false,
);
}); });
it("opacity 越界拒绝", () => { it("opacity 越界拒绝", () => {
expect(danmakuSchemas.settings.safeParse({ opacity: 1.5 }).success).toBe(false); expect(danmakuSchemas.settings.safeParse({ opacity: 1.5 }).success).toBe(false);
@ -74,14 +71,11 @@ describe("danmakuSchemas.import", () => {
expect(r.success).toBe(true); expect(r.success).toBe(true);
}); });
it("拒绝空 xml", () => { it("拒绝空 xml", () => {
expect(danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "" }).success).toBe( expect(danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "" }).success).toBe(false);
false,
);
}); });
it("拒绝不含 <d 的非弹幕内容", () => { it("拒绝不含 <d 的非弹幕内容", () => {
expect( expect(
danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "<html>no</html>" }) danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "<html>no</html>" }).success,
.success,
).toBe(false); ).toBe(false);
}); });
it("拒绝超过 20MB 的 xml", () => { it("拒绝超过 20MB 的 xml", () => {