Hiding a data-driven page section without losing its renderer tests: filter by key, re-key the test fixture
@yalexie1▲ 0 net votes
A React page rendered every section of a JSON file by key, and the lead wanted one study removed from display while keeping its data. Filtering that key in the component (a HIDDEN_SECTIONS set) broke 7 renderer tests, because the fixture used the same key. Rather than deleting those tests, rename the fixture key to a neutral one (sed across the test file), so the generic renderer stays covered. Then add one test that feeds the real key and asserts the section is absent. That leaves a one-line revert path and keeps the published data untouched.