test(domain): R5.7 port the contracts only the TS suites checked
612 leaves and 26 legacy ids (curation_leaves), region inference, R5.1 ledger rows, generated folder lists, migration-map oracle entry by entry, overlay removal, halo filter, CHG-000 and dollar-tag refusals; report-v2 fixtures moved to crates/core/tests (sha256 unchanged).
This commit is contained in:
1 parent
756b7ef34d
commit
0da7d3ab9f
11 files changed
+634
-11
No files matched your search
@@ -39,3 +39,37 @@ fn the_frozen_envelopes_parse_and_print_as_their_attachment() {
|
||||
assert_eq!(to_js_pretty(&envelope).unwrap(), text, "{name}");
|
||||
}
|
||||
}
|
||||
|
||||
/// `r2-oracles.test.ts` on `migration-map.draft.json` (R5.7): what Zod read from the map the
|
||||
/// TypeScript wrote (the pre-switch copy) is what the core reads, entry by entry, nulls
|
||||
/// included; the committed map since R5.6 differs only by the sheet fingerprint.
|
||||
#[test]
|
||||
fn the_draft_migration_map_reads_as_zod_read_it_entry_by_entry() {
|
||||
let (_, oracle) = common::oracle_file("migration-map.draft.json");
|
||||
let frozen: ReportMigrationMap = serde_json::from_value(oracle["output"].clone()).unwrap();
|
||||
let pre_switch =
|
||||
common::repo_file("crates/core/tests/fixtures/r5-6/pre-switch/report-migration-map.json");
|
||||
let read: ReportMigrationMap =
|
||||
serde_json::from_value(parse_json(&pre_switch).unwrap()).unwrap();
|
||||
assert_eq!(read, frozen);
|
||||
assert_eq!(
|
||||
(
|
||||
read.annotations.len(),
|
||||
read.finding_paths.len(),
|
||||
read.views.len()
|
||||
),
|
||||
(27, 792, 1)
|
||||
);
|
||||
let nulls = read.finding_paths.values().filter(|p| p.is_none()).count();
|
||||
assert_eq!(nulls, 34);
|
||||
let committed =
|
||||
common::repo_file("supabase/seed/anatomical-sheets/equine/draft/report-migration-map.json");
|
||||
let mut committed: ReportMigrationMap =
|
||||
serde_json::from_value(parse_json(&committed).unwrap()).unwrap();
|
||||
assert_eq!(
|
||||
committed.sheet.document_sha256,
|
||||
"12d788727c1e532641bd5b3a7ecf39dbdd25e70350f8a76be5ca917b262874e2"
|
||||
);
|
||||
committed.sheet.document_sha256 = frozen.sheet.document_sha256.clone();
|
||||
assert_eq!(committed, frozen);
|
||||
}
|
||||
Reference in new issue
Block a user