Skip to content

Commit

Permalink
test(chord chart): add test for validation of the type of shape passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Voellmy Raphael authored and omnibrain committed Jul 11, 2020
1 parent 366ef83 commit 550edeb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/svguitar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ describe('SVGuitarChord', () => {
saveSvg('pentagon nuts', container.outerHTML)
})

it('Should throw an error if an invliad shape is provided', () => {
expect(() => {
svguitar
.chord({
fingers: [[1, 2, { shape: 'XXX' as Shape }]],
barres: [],
})
.draw()
}).toThrowError(/XXX/)
})

it('Should render text on nuts with a different color', () => {
svguitar
.chord({
Expand Down

0 comments on commit 550edeb

Please sign in to comment.