Skip to content

test: allow only one "What's new" deck, in latest - #2110

Open
adnan-bhaldar wants to merge 1 commit into
KnifeLemon:mainfrom
adnan-bhaldar:test/whats-new-single-latest-deck
Open

adnan-bhaldar wants to merge 1 commit into
KnifeLemon:mainfrom
adnan-bhaldar:test/whats-new-single-latest-deck

Conversation

@adnan-bhaldar

Copy link
Copy Markdown
Collaborator

Tip

Start the title with a prefix so the PR is labeled automatically: feat: fix: docs: ci: build: i18n:
Example: fix(hwp): keep tables when converting to DOCX

Note

Please write the title and description in English so reviewers and future contributors can follow the change. Code comments are in English too (see CONTRIBUTING.md).

What does this change?

Follow-up to #1989, as suggested in its review. Every_deck_ships_with_its_media_and_texts (in tests/Filee.App.Tests/WhatsNewTests.cs) still accepted any number of decks and only checked that slide media sit under Assets/WhatsNew/. Since #1989 the rule is "only the newest deck, in latest/", so the test now enforces that. Test only: no app code, assets or docs change.

  • Assert.NotEmpty(decks) -> Assert.Single(decks). SlideDeck.LoadAll returns one deck for every slides.json it finds under Assets/WhatsNew/. NotEmpty passed for any number of decks, so a release that added a version folder (for example 2.7.0/) next to latest/ went unnoticed, and its media would ship in every installer. Single also still fails if there is no deck at all, as NotEmpty did.
  • Media prefix .../WhatsNew/ -> .../WhatsNew/latest/. A slide in the one deck could point at any folder under WhatsNew/. Now its media must be in latest/, matching the rule in CONTRIBUTING.md.

Why

Per the flow in CONTRIBUTING.md ("What's new" slides for a release), a release replaces the files in Assets/WhatsNew/latest/ and the whats_new.latest.* keys, and never adds a folder. Before #1989 each release added a folder named after its version, and old decks piled up although the app only shows the newest. The guard makes sure that rule is not broken by mistake.

What stays the same

  • The rest of the test (slide count between 5 and 7, unique slide ids, media exists, title and text keys exist in English) is unchanged.
  • Slide_media_stay_small and the other WhatsNewTests are unchanged.
  • No files are moved, created or deleted by the test; it only checks.

Type of change

  • Bug fix
  • New feature or improvement
  • New format or engine
  • Translation
  • Documentation
  • Build, CI or dependencies

How was it tested?

  • dotnet format --verify-no-changes
  • dotnet test

Checklist

  • New UI strings are in all src/Filee.App/Assets/i18n/*.json files (None Added)
  • New third-party code or binaries are listed in THIRD-PARTY-NOTICES.md (None Added)
  • The PR does one thing (unrelated changes go in a separate PR)

Every_deck_ships_with_its_media_and_texts now asserts a single deck and
that its media live under Assets/WhatsNew/latest/, so a release that adds
a second deck folder by mistake fails the test instead of shipping.

Follow-up to KnifeLemon#1989.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant