optimize transpose service
This commit is contained in:
15
src/app/modules/songs/services/key.helper.spec.ts
Normal file
15
src/app/modules/songs/services/key.helper.spec.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {getScale, scaleMapping} from './key.helper';
|
||||
|
||||
describe('key.helper', () => {
|
||||
it('should render Gb correctly', () => {
|
||||
expect(scaleMapping['Gb']).toBe('G♭');
|
||||
});
|
||||
|
||||
it('should expose a sharp-based scale for D', () => {
|
||||
expect(getScale('D')).toEqual(['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'H']);
|
||||
});
|
||||
|
||||
it('should keep flat-based spelling for Db', () => {
|
||||
expect(getScale('Db')).toEqual(['C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb', 'G', 'Ab', 'A', 'B', 'H']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user