From b809a8de1468efd4a53a0fab554308971e414c65 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 27 Oct 2026 05:54:04 +0100 Subject: [PATCH] Distinguish new career news from participant changes in entry checks (by Codex) --- tests/modern_entry_ui_tests.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/modern_entry_ui_tests.cpp b/tests/modern_entry_ui_tests.cpp index c4a0cf0..94a2b48 100644 --- a/tests/modern_entry_ui_tests.cpp +++ b/tests/modern_entry_ui_tests.cpp @@ -283,6 +283,7 @@ void additional_managers(const Fixture &fixture) { } void club_migration(const Fixture &fixture) { DemoSource started(fixture.world), edited(fixture.world); + const auto historical_news = edited.snapshot().state.at("news"); auto rows = Json::array({manager(1), manager(2)}); require(edited.apply({0, "managers", rows}).ok, "Reference manager club switch failed"); @@ -294,6 +295,22 @@ void club_migration(const Fixture &fixture) { reference["opening"] = "pending"; reference["opening_created"] = false; reference["opening_flow"] = make_demo_opening(*fixture.world, reference, true); + require(reference.at("news") == historical_news, + "Changing participants rewrote historical news"); + const auto &fresh_news = actual.at("news").at("items"); + require(!fresh_news.empty() && actual.at("news") != historical_news && + std::all_of(fresh_news.begin(), fresh_news.end(), + [&](const auto &item) { + return item.at("scope").at("id") == + "club:entry-1" && + item.at("owner").at("name") == + actual.at("managers")[0].at("name"); + }), + "New career did not bind fresh news to its confirmed first manager"); + // A new career creates its own journal; changing participants preserves it. + // The remaining club-dependent presentation migrations must still agree. + reference.erase("news"); + actual.erase("news"); require( reference == actual, "Start diverges from established club-change presentation migrations");