refactor(domain): encode comparison and lifecycle states exactly (#473)
* refactor(domain): encode comparison states exactly * refactor(domain): make evidence lifecycles explicit * refactor(browser): parse capture states once * test: prefer behavior over implementation seams * chore: refresh schema-derived metadata * test(process): preserve lifecycle cleanup coverage * test(hopper): bind rename cache coverage to dispatch
This commit is contained in:
@@ -13,6 +13,9 @@ import {
|
||||
} from "../../fixtures/fakeCdpBrowser.js";
|
||||
|
||||
const browsers: FakeCdpBrowser[] = [];
|
||||
const expectInvalidDiff = (input: unknown): void => {
|
||||
expect(webCaptureDiffSchema.safeParse(input).success).toBe(false);
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(browsers.splice(0).map(async (browser) => browser.close()));
|
||||
@@ -58,6 +61,21 @@ describe("web capture diff", () => {
|
||||
status: "unknown",
|
||||
total_changes: 0,
|
||||
});
|
||||
expectInvalidDiff({ ...result, overall_status: "unchanged" });
|
||||
expectInvalidDiff({
|
||||
...result,
|
||||
dimensions: {
|
||||
...result.dimensions,
|
||||
webmcp: { ...result.dimensions.webmcp, reason: null },
|
||||
},
|
||||
});
|
||||
expectInvalidDiff({
|
||||
...result,
|
||||
dimensions: {
|
||||
...result.dimensions,
|
||||
scripts: { ...result.dimensions.scripts, total_changes: 2 },
|
||||
},
|
||||
});
|
||||
const {
|
||||
accessibility: _accessibility,
|
||||
storage: _storage,
|
||||
|
||||
Reference in New Issue
Block a user