From c772b525cc801e939e394bcb34591c91289de2a3 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 27 May 2026 11:10:12 -0300 Subject: [PATCH 1/2] feat: Add cavaquinho as static instrument - Import cavaquinho chords from @tombatossals/chords-db - Add cavaquinho instrument to instruments object - Configure with 4 strings and D-G-B-D tuning - Cavaquinho now appears in chord browser alongside Guitar, Ukulele, Piano Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- my-chords-tester/src/App.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/my-chords-tester/src/App.js b/my-chords-tester/src/App.js index a89835210..ee1148cd6 100644 --- a/my-chords-tester/src/App.js +++ b/my-chords-tester/src/App.js @@ -4,6 +4,7 @@ import ChordBlock from '@tombatossals/react-chords/lib/Chord/ChordBlock' import guitarChords from '@tombatossals/chords-db/lib/guitar.json'; import ukuleleChords from '@tombatossals/chords-db/lib/ukulele.json'; import pianoChords from '@tombatossals/chords-db/lib/piano.json'; +import cavaquinhoChords from '@tombatossals/chords-db/lib/cavaquinho.json'; import { addMidiToPosition } from '@tombatossals/react-chords/lib/Chord/midiUtils'; import './App.css'; @@ -46,6 +47,19 @@ const instruments = { standard: [] } } + }, + cavaquinho: { + name: 'Cavaquinho', + chords: cavaquinhoChords, + config: { + strings: 4, + fretsOnChord: 4, + name: 'Cavaquinho', + keys: [], + tunings: { + standard: ['D', 'G', 'B', 'D'] + } + } } }; From 8070c83f23364e92461c1d34924a68077dfceac4 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 27 May 2026 11:10:38 -0300 Subject: [PATCH 2/2] test: Add cavaquinho instrument tests - Test that cavaquinho appears in instrument selector - Test that cavaquinho is navigable - Test all 4 instruments are rendered (Guitar, Ukulele, Piano, Cavaquinho) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- my-chords-tester/src/App.test.js | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/my-chords-tester/src/App.test.js b/my-chords-tester/src/App.test.js index 1f03afeec..5dd492d5e 100644 --- a/my-chords-tester/src/App.test.js +++ b/my-chords-tester/src/App.test.js @@ -1,8 +1,30 @@ import { render, screen } from '@testing-library/react'; import App from './App'; +import { BrowserRouter } from 'react-router-dom'; -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); +describe('Cavaquinho Instrument Support', () => { + test('renders all instruments including cavaquinho', () => { + render( + + + + ); + + expect(screen.getByText('Guitar')).toBeInTheDocument(); + expect(screen.getByText('Ukulele')).toBeInTheDocument(); + expect(screen.getByText('Piano')).toBeInTheDocument(); + expect(screen.getByText('Cavaquinho')).toBeInTheDocument(); + }); + + test('cavaquinho is navigable', () => { + render( + + + + ); + + const cavaquinhoLink = screen.getByText('Cavaquinho'); + expect(cavaquinhoLink).toBeInTheDocument(); + expect(cavaquinhoLink.closest('a')).toHaveAttribute('href', '/cavaquinho'); + }); });