Repository navigation
test(api): pin filtered country counts and the plain place-list keys - #503
Merged
Merged
Conversation
Place lists already follow the filters (#371). These cases cover what fetch.test.ts left open: getCountries with and without filters (a country nothing matches drops out), and regionQuery/countriesQuery keeping the plain key their writers use when no filter is active. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
🤖 no session running Written by the sydevs dispatcher. Sessions never edit this comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetch.test.tsleft untested.getCountriesunder filters, and the plain query keys live preview and the boot warm-up write.Change outline
Behaviour — what the new cases pin
describe('getRegion (region-tree derivation)') src/config/api/fetch.test.ts … it('counts and lists only what the filters let through, framing on everything') + it('counts countries only by what the filters let through, and drops a country with none') + getCountries() → belgium 5 + getCountries(DEFAULT_FILTERS) → same as no filters + getCountries({ format: online }) → belgium 2 + getCountries({ languages: [xx] }) → [] # nothing matches: the country drops out + it('keys an unfiltered place list exactly as its writers do, and a filtered one apart') + regionQuery(slug, locale, DEFAULT_FILTERS) → ['region', slug, locale] + countriesQuery(DEFAULT_FILTERS) → ['countries'] + format alone, or region alone → a key apart from the plain one it('counts online classes under the region cut, not worldwide')Preview
No preview surface: tests only, no shipped code changes.
Test results
test:run: 206 files, 2584 passed, 1 skipped)src/config/api/fetch.test.ts36 passedgetCountriesignoring filters;regionQuery/countriesQuerykeying on filters when none are active;activeFilterCountdroppingregionNotes for reviewer
Tiny diff, read inline. Security review ran (
src/config/api/path trigger): no findings.Detail
Filed from the "place lists follow the filters" ticket, whose fix (ported from 032f476 on
ux/states) had already landed in #371:visibleFeaturesingetCountries/getRegion,getOnlineCount, filter-awareregionQuery/countriesQuery, andActiveFilterPills+ theno-resultspanel +useFilterSearchlinks in CountriesView, RegionView and OnlineView. The ticket's tests item was the only part still open.Self-review (
/code-review high) findings:/?langs=xxreaches the no-results panel; it pins only the empty list.regioncut alone marks filters active, so a region-only key could share the unfiltered entry. Added.languagesorder in the key is already pinned byfiltersKey's own spec insrc/lib/shape/filters.test.ts.countriesQueryis imported from./fetch, where it is declared. That import predates this branch.getRegiondescribe, which already holds thegetCountries,getOnlineCountandcountriesQuerywarm-up cases that share its fixtures.Docs checked, nothing stale.
🤖 Generated with Claude Code