style(types): biome format media-schemas.test.ts
This commit is contained in:
parent
9ef9dd01a5
commit
cb770d1e56
|
|
@ -54,12 +54,9 @@ describe("danmakuSchemas.settings", () => {
|
|||
});
|
||||
it("blockTypes 只接受 scroll|top|bottom", () => {
|
||||
expect(
|
||||
danmakuSchemas.settings.safeParse({ blockTypes: ["scroll", "top", "bottom"] })
|
||||
.success,
|
||||
danmakuSchemas.settings.safeParse({ blockTypes: ["scroll", "top", "bottom"] }).success,
|
||||
).toBe(true);
|
||||
expect(danmakuSchemas.settings.safeParse({ blockTypes: ["reverse"] }).success).toBe(
|
||||
false,
|
||||
);
|
||||
expect(danmakuSchemas.settings.safeParse({ blockTypes: ["reverse"] }).success).toBe(false);
|
||||
});
|
||||
it("opacity 越界拒绝", () => {
|
||||
expect(danmakuSchemas.settings.safeParse({ opacity: 1.5 }).success).toBe(false);
|
||||
|
|
@ -74,14 +71,11 @@ describe("danmakuSchemas.import", () => {
|
|||
expect(r.success).toBe(true);
|
||||
});
|
||||
it("拒绝空 xml", () => {
|
||||
expect(danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "" }).success).toBe(
|
||||
false,
|
||||
);
|
||||
expect(danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "" }).success).toBe(false);
|
||||
});
|
||||
it("拒绝不含 <d 的非弹幕内容", () => {
|
||||
expect(
|
||||
danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "<html>no</html>" })
|
||||
.success,
|
||||
danmakuSchemas.import.safeParse({ mediaItemId: "m1", xml: "<html>no</html>" }).success,
|
||||
).toBe(false);
|
||||
});
|
||||
it("拒绝超过 20MB 的 xml", () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue