Add integration tests for chord-mark public API#669
Merged
Conversation
Test parseSong, renderSong, and lineTypes exclusively through the public API (src/chordMark.js). 17 test files with 205 tests organized by concept: basics, chords, time signatures, sections, keys, errors, alignment, transposition, filtering, sub-beats, and options. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace vague toContain checks with exact toBe assertions using the full expected output. Fix positioned chords to assert exact chordPositions array and lyrics content. Verify exact allChords count, first/last chord identity, and sub-beat group structure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Break string literals at \n boundaries so each rendered line is visually on its own line in the test code, making it easier to review expected output at a glance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- parseSong-keys: verify originalKey is set on chord lines with
correct key string and accidental, not just allChords.length > 0
- parseSong-sections: replace > 0 / >= 2 guards with exact counts
and type verification for isFromSectionCopy (6 lines),
isFromSectionMultiply (3 lines), isFromAutoRepeatChords (1 line)
- parseSong-chords: verify %% repeats the correct chord line content
(C.. G..), not just the isFromChordLineRepeater flag
- renderSong-time-signatures: use exact toBe for inline TS default
test instead of vague toContain('2/4')
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
parseSong,renderSong, andlineTypesexclusively through the public API (src/chordMark.js)Test plan
npx jest --testPathPattern="integration-public-api" --verbose— all 204 tests passnpx jest --coverage— full suite (1507 tests) passes with 100% coveragegit diff packages/chord-mark/src/— no source files modified🤖 Generated with Claude Code