Skip to content

Commit d8fad15

Browse files
author
Salma Alam-Naylor
committed
Added an extra test for similar modes
1 parent 17fae6d commit d8fad15

File tree

2 files changed

+105
-2
lines changed

2 files changed

+105
-2
lines changed

apps/fretonator-web/src/app/common/fret-map/fret-map.service.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
cIonianFretMappings,
1414
cIonianMode,
1515
cIonianSimilarModes,
16+
cLydianMode,
17+
cLydianSimilarModes,
1618
cMajorPentatonicChordMap,
1719
cMinorPentatonicChordMap,
1820
cPhrygianMode,
@@ -1406,13 +1408,16 @@ describe('FretMapService:getSimilarModes', () => {
14061408

14071409
it('returns correctly for an input of c natural ionian', () => {
14081410
const result = service.getSimilarModes(cIonianMode, Mode.ionian);
1409-
14101411
expect(result).toEqual(cIonianSimilarModes);
14111412
});
14121413

1414+
it('returns correctly for an input of c natural lydian', () => {
1415+
const result = service.getSimilarModes(cLydianMode, Mode.lydian);
1416+
expect(result).toEqual(cLydianSimilarModes);
1417+
});
1418+
14131419
it('returns an empty array for a mode not in the StandardModePatterns array', () => {
14141420
const result = service.getSimilarModes(fSharpHarmonicMinor, Mode.harmonicMinor);
1415-
14161421
expect(result).toEqual([]);
14171422
});
14181423
});

apps/fretonator-web/src/app/common/fret-map/fret-map.service.testConstants.ts

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,65 @@ export const cIonianMode: ModeMap = [
446446
},
447447
];
448448

449+
export const cLydianMode: ModeMap = [
450+
{
451+
name: 'c',
452+
sharp: false,
453+
flat: false,
454+
doubleFlat: false,
455+
doubleSharp: false,
456+
displayName: 'C'
457+
},
458+
{
459+
name: 'd',
460+
sharp: false,
461+
flat: false,
462+
doubleFlat: false,
463+
doubleSharp: false,
464+
displayName: 'D'
465+
},
466+
{
467+
name: 'e',
468+
sharp: false,
469+
flat: false,
470+
doubleFlat: false,
471+
doubleSharp: false,
472+
displayName: 'E'
473+
},
474+
{
475+
name: 'f',
476+
sharp: true,
477+
flat: false,
478+
doubleFlat: false,
479+
doubleSharp: false,
480+
displayName: 'F'
481+
},
482+
{
483+
name: 'g',
484+
sharp: false,
485+
flat: false,
486+
doubleFlat: false,
487+
doubleSharp: false,
488+
displayName: 'G'
489+
},
490+
{
491+
name: 'a',
492+
sharp: false,
493+
flat: false,
494+
doubleFlat: false,
495+
doubleSharp: false,
496+
displayName: 'A'
497+
},
498+
{
499+
name: 'b',
500+
sharp: false,
501+
flat: false,
502+
doubleFlat: false,
503+
doubleSharp: false,
504+
displayName: 'B'
505+
},
506+
];
507+
449508
export const dDorianMode: ModeMap = [
450509
{
451510
name: 'd',
@@ -1248,3 +1307,42 @@ export const cIonianSimilarModes = [
12481307
noteExtender: 'natural'
12491308
}
12501309
]
1310+
1311+
export const cLydianSimilarModes = [
1312+
{
1313+
noteDisplayName: 'D',
1314+
note: 'd',
1315+
mode: 'mixolydian',
1316+
noteExtender: 'natural'
1317+
},
1318+
{
1319+
noteDisplayName: 'E',
1320+
note: 'e',
1321+
mode: 'aolian',
1322+
noteExtender: 'natural'
1323+
},
1324+
{
1325+
noteDisplayName: 'F',
1326+
note: 'f',
1327+
mode: 'locrian',
1328+
noteExtender: 'sharp'
1329+
},
1330+
{
1331+
noteDisplayName: 'G',
1332+
note: 'g',
1333+
mode: 'ionian',
1334+
noteExtender: 'natural'
1335+
},
1336+
{
1337+
noteDisplayName: 'A',
1338+
note: 'a',
1339+
mode: 'dorian',
1340+
noteExtender: 'natural'
1341+
},
1342+
{
1343+
noteDisplayName: 'B',
1344+
note: 'b',
1345+
mode: 'phrygian',
1346+
noteExtender: 'natural'
1347+
}
1348+
]

0 commit comments

Comments
 (0)