Repository navigation
tests: cover untested journey.js exports and normalizeTheme edge case - #12
Open
ashishbhateja wants to merge 1 commit into
Open
ashishbhateja wants to merge 1 commit into
ashishbhateja wants to merge 1 commit into
Conversation
monthsOfMovement was exported but never directly tested — adds a check that it returns months in calendar order for a given movement id. Adds two further journey.js edge-case checks: movementOf() called with a month number (the numeric branch of its overloaded argument), and mirrorOf() returning null for a month with no mirror relationship (June). Adds an explicit normalizeTheme check that verifies both lowercasing and whitespace trimming, which were relied on throughout the test suite but never asserted directly. 19 → 23 checks, all passing.
This branch has not been deployed
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.
What
Adds 4 new checks to
scripts/smoke.mjscovering gaps in the existing test suite (19 → 23 checks).New checks
monthsOfMovementmovementOf5) to its movementmirrorOfnullfor a month with no mirror (June)normalizeTheme' Integral Yoga '→'integral yoga')Why
monthsOfMovementis a public, documented export thatasMovementsdelegates to internally. Its contract (filtered, sorted by number) was only covered transitively throughasMovements. A direct test pins that contract.The
movementOfoverloaded-argument andmirrorOfnull-return paths are plausible call sites in UI code; testing them now means a future refactor can't silently break them.normalizeTheme's trimming behaviour matters because reader-stored interests are normalised before being compared to article themes — a leading/trailing space would silently break matching.Checklist
node scripts/smoke.mjs)node scripts/build.mjs content/sample-edition.json)Generated by Claude Code