Skip to content

fix(test): decouple MetadataConfig block-scalar test from shipping copy - #1007

Merged
wei18 merged 1 commit into
mainfrom
fix/1004-metadata-config-test
Aug 12, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/1004-metadata-config-test

Conversation

@wei18

@wei18 wei18 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • MetadataConfigLoadTests.decodesBlockScalar hardcoded exact marketing prose ("Truly cross-platform", "iPhone and Mac"); feat(store): apply marketing copy overhaul (P1-P5) across 7 locales #986's copy overhaul made both go stale, leaving Packages/ASCRegisterKit red (3 issues) on a clean main even though the config and the decoder were both correct.
  • Replaced it with decodesBlockScalarFixture, which asserts the actual decoder property (block-scalar chomping + embedded blank-line paragraph preservation) against a fixture the test owns (Tests/ASCRegisterTests/Fixtures/BlockScalarFixture/), fully decoupled from shipping copy.
  • Kept a separate liveConfigSmokeParses test against the real docs/app-store/metadata files that only checks parse-success + structural invariants (non-empty, blank-line preserved, no trailing newline) — never specific prose.

Block-scalar form inventory (production)

Inventoried every app-meta.yaml/listing.yaml under docs/app-store/metadata:

  • |- (literal, strip chomping) — every listing.yaml's description / whats_new / promotional_text.
  • | (literal, clip chomping) — app-meta.yaml review_information.notes_summary and iap/*.yaml review_notes.
  • No > folded scalars and no explicit indentation indicators appear anywhere.

The fixture exercises both forms actually in use; it does not invent coverage for forms production never uses.

Test plan

  • swift test --package-path Packages/ASCRegisterKit — 195 tests, 0 issues (was 194 tests, 3 issues on main).
  • Regression demo: temporarily sabotaged MetadataConfig.str() to collapse embedded blank lines, both the fixture test (3 issues) and the live smoke test (1 issue) failed; reverted, verified git diff on the source file is empty, full suite green again.
  • swiftlint lint --strict clean on the changed test file (0 violations).

closes #1004

🤖 Generated with Claude Code

The #986 marketing copy overhaul dropped "Truly cross-platform" and
switched the subtitle to "&", turning 3 assertions in
`decodesBlockScalar` red on a clean main even though both the config
and the decoder were correct. Because that test hardcoded exact
marketing prose, every future copy edit would break it again, and a
genuine block-scalar decoder regression could now hide behind the
noise.

Replace the prose assertions with a fixture the test owns
(Fixtures/BlockScalarFixture/), exercising the two block-scalar forms
production actually uses (`|-` strip, `|` clip — inventoried across
every app-meta.yaml/listing.yaml; no `>` folded scalars appear
anywhere), asserting exact round-trip strings, paragraph count, and
no-trailing-newline chomping normalization. Keep a separate
`liveConfigSmokeParses` test against the real files that checks only
parse-success and structural invariants, never prose.

Verified the new test still catches a real decoder regression: with
`str()` in MetadataConfig.swift temporarily sabotaged to collapse
embedded blank lines, both the fixture test and the live smoke test
fail (4 issues); reverted, full suite is green again.

closes #1004

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wei18
wei18 merged commit 5049a98 into main Aug 12, 2026
6 checks passed
@wei18
wei18 deleted the fix/1004-metadata-config-test branch August 12, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(test): MetadataConfig block-scalar test asserts stale marketing copy, red on main

1 participant