Skip to content

Commit f4256e3

Browse files
parthdagia05Parth
andauthored
Add unit tests for getStepSizeDown in musicutils. (sugarlabs#5520)
* test: add unit tests for getStepSizeDown in musicutils * resolving conflicts --------- Co-authored-by: Parth <dagia@Parths-MacBook-Pro.local>
1 parent b87770a commit f4256e3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

js/utils/__tests__/musicutils.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,18 @@ describe("_calculate_pitch_number", () => {
22712271
});
22722272
});
22732273

2274+
describe("getStepSizeDown", () => {
2275+
it("should return the correct step size for D in C major going down", () => {
2276+
const result = getStepSizeDown("C major", "D", 0, "equal");
2277+
expect(result).toBe(-2);
2278+
});
2279+
2280+
it("should return 0 for an invalid temperament", () => {
2281+
const result = getStepSizeDown("C major", "D", 0, "invalid");
2282+
expect(result).toBe(0);
2283+
});
2284+
});
2285+
22742286
describe("getStepSizeUp", () => {
22752287
it("should return the correct step size for C in C major going up", () => {
22762288
const result = getStepSizeUp("C major", "C", 0, "equal");

0 commit comments

Comments
 (0)