mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
test(views): share retained view success projection (#16846)
This commit is contained in:
1 parent
1678ca46a5
commit
48fc7116fb
4 files changed
+16
-26
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { projectView as project } from "../../../tests/fixtures/projectAnalysisView.js";
|
||||
import {
|
||||
androidPackageComponent as component,
|
||||
androidPackageReport as report,
|
||||
@@ -33,15 +34,6 @@ const parent = (value = report()): AnalysisViewParent => {
|
||||
limitations: evidence.limitations,
|
||||
};
|
||||
};
|
||||
const project = (source: AnalysisViewParent, view: unknown) => {
|
||||
const result = projectAnalysisView(
|
||||
source,
|
||||
analysisViewRequestSchema.parse(view),
|
||||
);
|
||||
if (!result.ok) throw result.error;
|
||||
return result.value;
|
||||
};
|
||||
|
||||
it("keeps parent ordinals, duplicate declarations and coverage after filtering, paging and field selection", () => {
|
||||
const source = parent();
|
||||
const before = JSON.stringify(source);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { projectView as project } from "../../../tests/fixtures/projectAnalysisView.js";
|
||||
import { UNKNOWN_EVIDENCE_SUBJECT } from "../../../tests/fixtures/evidenceSubject.js";
|
||||
import { expect, it } from "vitest";
|
||||
import { freezeJsonSnapshot } from "../immutableJson.js";
|
||||
@@ -27,15 +28,6 @@ const parent = (normalizedResult: unknown): AnalysisViewParent => ({
|
||||
parameters: { pattern: "a", mode: "literal", case_sensitive: false },
|
||||
limitations: ["Provider discovery is partial."],
|
||||
});
|
||||
const project = (source: AnalysisViewParent, view: unknown) => {
|
||||
const result = projectAnalysisView(
|
||||
source,
|
||||
analysisViewRequestSchema.parse(view),
|
||||
);
|
||||
if (!result.ok) throw result.error;
|
||||
return result.value;
|
||||
};
|
||||
|
||||
it("pages exact source order and same-address alternatives, with selectable fields and stable row identity", () => {
|
||||
const original = rows();
|
||||
const source = parent(freezeJsonSnapshot(original));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { projectAnalysisView } from "./analysisView.js";
|
||||
import { projectView } from "../../../tests/fixtures/projectAnalysisView.js";
|
||||
import type { AnalysisViewParent } from "./analysisViewParent.js";
|
||||
import { analysisViewRequestSchema } from "./analysisViewRequest.js";
|
||||
|
||||
const digest = (fill: string) => fill.repeat(64);
|
||||
const file = (index: number, ffs_file?: unknown) => ({
|
||||
@@ -42,12 +41,7 @@ const project = (report: unknown, view: unknown) => {
|
||||
normalizedResult: report,
|
||||
limitations: [],
|
||||
};
|
||||
const result = projectAnalysisView(
|
||||
parent,
|
||||
analysisViewRequestSchema.parse(view),
|
||||
);
|
||||
if (!result.ok) throw result.error;
|
||||
return result.value;
|
||||
return projectView(parent, view);
|
||||
};
|
||||
|
||||
it("reads extraction Evidence saved before files recorded their FFS owner", () => {
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { projectAnalysisView } from "../../src/domain/analysisView/analysisView.js";
|
||||
import type { AnalysisViewParent } from "../../src/domain/analysisView/analysisViewParent.js";
|
||||
import { analysisViewRequestSchema } from "../../src/domain/analysisView/analysisViewRequest.js";
|
||||
|
||||
export const projectView = (parent: AnalysisViewParent, view: unknown) => {
|
||||
const result = projectAnalysisView(
|
||||
parent,
|
||||
analysisViewRequestSchema.parse(view),
|
||||
);
|
||||
if (!result.ok) throw result.error;
|
||||
return result.value;
|
||||
};
|
||||
Reference in new issue
Block a user