migration: preserve frontend shell pages and styles

This commit is contained in:
leefer
2026-07-31 15:08:57 +08:00
parent 38de3de0a3
commit dec3cd1236
92 changed files with 10758 additions and 9449 deletions
@@ -7,6 +7,12 @@ from pathlib import Path
import market_insights
from backend.features.market import insights as canonical_insights
from tests.preservation_helpers import (
ORIGINAL_STATIC,
assert_moved_asset_matches,
assert_page_prefix_matches,
reassembled_frontend_runtime,
)
APP_ROOT = Path(__file__).resolve().parents[1]
@@ -174,21 +180,22 @@ class MarketInsightsSliceSourceEquivalenceTests(unittest.TestCase):
self.assertEqual(migrated[name], original[name], name)
def test_api_and_frontend_assets_are_unchanged(self) -> None:
for relative in (
"config/api.config.json",
"static/index.html",
"static/app.js",
"static/styles.css",
"static/pages/auction/page.js",
"static/pages/themes/page.js",
"static/pages/popularity/page.js",
"static/pages/dragon-tiger/page.js",
self.assertEqual(
sha256(APP_ROOT / "config/api.config.json"),
sha256(ORIGINAL_ROOT / "config/api.config.json"),
)
self.assertEqual(
reassembled_frontend_runtime(),
(ORIGINAL_STATIC / "app.js").read_text(encoding="utf-8"),
)
assert_moved_asset_matches(self, "styles.css", "styles/styles.css")
for page in (
"pages/auction/page.js",
"pages/themes/page.js",
"pages/popularity/page.js",
"pages/dragon-tiger/page.js",
):
self.assertEqual(
sha256(APP_ROOT / relative),
sha256(ORIGINAL_ROOT / relative),
relative,
)
assert_page_prefix_matches(self, page)
if __name__ == "__main__":