migration: audit uncertain code and prepare handoff

This commit is contained in:
leefer
2026-07-31 16:48:13 +08:00
parent 66c22a5449
commit bc25e06416
14 changed files with 94 additions and 1155 deletions
+3 -7
View File
@@ -7,18 +7,15 @@ from backend.bootstrap.config import APP_DIR, STATIC_DIR
from tests.preservation_helpers import (
FRONTEND_ROOT,
ORIGINAL_STATIC,
assert_frontend_runtime_matches_audited_baseline,
assert_moved_asset_matches,
assert_page_prefix_matches,
reassembled_frontend_runtime,
)
class FrontendPreservationSliceTests(unittest.TestCase):
def test_split_runtime_reassembles_to_the_exact_original(self) -> None:
self.assertEqual(
reassembled_frontend_runtime(),
(ORIGINAL_STATIC / "app.js").read_text(encoding="utf-8"),
)
def test_split_runtime_matches_original_except_audited_retirements(self) -> None:
assert_frontend_runtime_matches_audited_baseline(self)
def test_index_diff_is_limited_to_asset_relocation_and_split_loading(self) -> None:
migrated = (FRONTEND_ROOT / "index.html").read_text(encoding="utf-8")
@@ -64,7 +61,6 @@ class FrontendPreservationSliceTests(unittest.TestCase):
for original, migrated in (
("ui-core.js", "shared/ui-core.js"),
("heaven-loading-v2.js", "pages/heaven/loading-v2.js"),
("heaven-loading.js", "heaven-loading.js"),
("vendor/lucide.min.js", "vendor/lucide.min.js"),
("pages.config.js", "pages.config.js"),
("pages/runtime.js", "pages/runtime.js"),