fix(musicutils): correct typo in convertFactor - 0.675 should be 0.625 (5/8)#7460
Conversation
|
🧪 Jest Test Results ❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Coverage: Statements: 48.23% | Branches: 39.77% | Functions: 52.95% | Lines: 48.62% Note: These failures may be introduced by this PR or may already exist in the master branch. Failed Tests: |
|
🧪 Jest Test Results ❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Coverage: Statements: 48.23% | Branches: 39.77% | Functions: 52.95% | Lines: 48.62% Note: These failures may be introduced by this PR or may already exist in the master branch. Failed Tests: |
Description
convertFactorinmusicutils.jsmaps beat duration values to their LilyPond string representations. The case for 5/8 contained a typo:The correct value for 5/8 is
0.625, not0.675. As a result:convertFactor(0.625)fell through todefaultand returnednullnotation.js, anullreturn silently drops the tempo or pickup marking in LilyPond export for any project using a 5/8 beat value - the notation is exported without the correct tempo/pickup0.675is unreachable in practice since no standard musical computation produces itThe existing test also contained the same typo and was therefore passing against the wrong value.
Related Issue
No related issue — bug identified through code analysis.
PR Category
Changes Made
js/utils/musicutils.js: changecase 0.675tocase 0.625js/utils/__tests__/musicutils.test.js: update test input from0.675to0.625, and addconvertFactor(0.675)to thenulltest to confirm it is not a valid factorTesting Performed
npm test -- musicutils- all tests passnpm test- no regressions introducedjs/widgets/__tests__/aidebugger.test.js(unrelated to this PR)Checklist
npm run lintandnpx prettier --check .with no errors.