mirror of
https://github.com/morluto/rea.git
synced 2026-12-02 13:11:18 -05:00
test(desktop): reuse archive draft checks
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { JsonValue } from "../jsonValue.js";
|
||||
import { evaluateTaskChecks } from "./appTaskChecks.js";
|
||||
import {
|
||||
draftOf,
|
||||
passing,
|
||||
@@ -816,18 +815,8 @@ it("keeps an added ID-only member when another XML archive entry independently a
|
||||
const checks = (drafted?.suggested ?? []).filter(
|
||||
(check) => "pointer" in check && check.pointer.includes("[name=other.xml]"),
|
||||
);
|
||||
expect(
|
||||
evaluateTaskChecks(
|
||||
checks.map((check, index) => ({ ...check, id: `c${index}` })),
|
||||
new Map([[file, { format: "zip", view: archive(false) }]]),
|
||||
).map(({ passed }) => passed),
|
||||
).toContain(false);
|
||||
expect(
|
||||
evaluateTaskChecks(
|
||||
checks.map((check, index) => ({ ...check, id: `c${index}` })),
|
||||
new Map([[file, { format: "zip", view: archive(true) }]]),
|
||||
).every(({ passed }) => passed),
|
||||
).toBe(true);
|
||||
expect(passing(file, archive(false), checks, "zip")).toContain(false);
|
||||
expect(passing(file, archive(true), checks, "zip").every(Boolean)).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps changed display text when its matching label belongs to another XML archive entry", () => {
|
||||
@@ -870,16 +859,8 @@ it("keeps changed display text when its matching label belongs to another XML ar
|
||||
(check) =>
|
||||
"pointer" in check && check.pointer.includes("[name=display.xml]"),
|
||||
);
|
||||
expect(
|
||||
evaluateTaskChecks(
|
||||
checks.map((check, index) => ({ ...check, id: `c${index}` })),
|
||||
new Map([[file, { format: "zip", view: archive("Old") }]]),
|
||||
).map(({ passed }) => passed),
|
||||
).toContain(false);
|
||||
expect(
|
||||
evaluateTaskChecks(
|
||||
checks.map((check, index) => ({ ...check, id: `c${index}` })),
|
||||
new Map([[file, { format: "zip", view: archive("New") }]]),
|
||||
).every(({ passed }) => passed),
|
||||
).toBe(true);
|
||||
expect(passing(file, archive("Old"), checks, "zip")).toContain(false);
|
||||
expect(passing(file, archive("New"), checks, "zip").every(Boolean)).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user