Skip to content

Commit 6afb76f

Browse files
committed
Fix linting issues and rename sharp.svg
- Fix trailing spaces and indentation - Change single quotes to double quotes - Rename sharp.svg to accidental-sharp.svg for consistency - Remove empty test describe block that was causing failures
1 parent 3e7053f commit 6afb76f

File tree

3 files changed

+4
-66
lines changed

3 files changed

+4
-66
lines changed
File renamed without changes.

js/utils/__tests__/synthutils.test.js

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -779,68 +779,6 @@ describe("Utility Functions (logic-only)", () => {
779779
it("it should start the sound", () => {
780780
expect(startSound("turtle1", "custom", "A")).toBe(undefined);
781781
});
782-
});
783-
784-
785-
describe("_performNotes", () => {
786-
let mockSynth;
787-
let mockTone;
788-
let instance;
789-
mockSynth = {
790-
triggerAttackRelease: jest.fn(),
791-
chain: jest.fn(),
792-
connect: jest.fn(),
793-
setNote: jest.fn(),
794-
oscillator: { partials: [] }
795-
};
796-
797-
beforeEach(() => {
798-
mockTone = {
799-
now: jest.fn(() => 0),
800-
Destination: {},
801-
Filter: jest.fn(),
802-
Vibrato: jest.fn(),
803-
Distortion: jest.fn(),
804-
Tremolo: jest.fn(),
805-
Phaser: jest.fn(),
806-
Chorus: jest.fn(),
807-
Part: jest.fn(),
808-
ToneAudioBuffer: {
809-
loaded: jest.fn().mockResolvedValue(true)
810-
}
811-
};
812-
global.Tone = mockTone;
813-
814-
// Mock synth
815-
mockSynth = {
816-
triggerAttackRelease: jest.fn(),
817-
chain: jest.fn(),
818-
connect: jest.fn(),
819-
setNote: jest.fn(),
820-
oscillator: { partials: [] }
821-
};
822-
823-
// Create instance with required properties
824-
instance = {
825-
inTemperament: "equal",
826-
_performNotes,
827-
_getFrequency: jest.fn(),
828-
getCustomFrequency: jest.fn()
829-
};
830-
831-
// Bind the provided function to our instance
832-
instance._performNotes = instance._performNotes.bind(instance);
833-
834-
// Mock timers
835-
jest.useFakeTimers();
836-
});
837-
838-
839-
840-
841-
842-
843-
844782
});
845783

846784
describe("whichTemperament", () => {

js/widgets/sampler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function SampleWidget() {
171171
// Update the block display to show cent adjustment if applicable
172172
if (this.centAdjustmentValue && this.centAdjustmentValue !== 0) {
173173
const centText = (this.centAdjustmentValue > 0 ? "+" : "") + this.centAdjustmentValue + "¢";
174-
if (this.activity.blocks.blockList[mainSampleBlock].text &&
174+
if (this.activity.blocks.blockList[mainSampleBlock].text &&
175175
this.activity.blocks.blockList[mainSampleBlock].text.text) {
176176
// Append cent adjustment to the block text if possible
177177
const currentText = this.activity.blocks.blockList[mainSampleBlock].text.text;
@@ -674,7 +674,7 @@ function SampleWidget() {
674674
tunerContainer.appendChild(tunerSvg);
675675

676676
const sharpSymbol = document.createElement("img");
677-
sharpSymbol.setAttribute("src", "header-icons/sharp.svg");
677+
sharpSymbol.setAttribute("src", "header-icons/accidental-sharp.svg");
678678
sharpSymbol.style.height = 40 + "px";
679679
sharpSymbol.style.width = 40 + "px";
680680
sharpSymbol.style.marginTop = "auto";
@@ -759,7 +759,7 @@ function SampleWidget() {
759759
targetIcon.style.pointerEvents = "none";
760760

761761
// Initial mode state
762-
let tunerMode = 'chromatic';
762+
let tunerMode = "chromatic";
763763

764764
// Function to update button styles
765765
const updateButtonStyles = () => {
@@ -801,7 +801,7 @@ function SampleWidget() {
801801
await this.activity.logo.synth.startTuner();
802802
activity.textMsg(_("Tuner started"), 3000);
803803

804-
} else {
804+
} else {
805805
activity.textMsg(_("Tuner stopped"), 3000);
806806
this.activity.logo.synth.stopTuner();
807807
tunerOn = false;

0 commit comments

Comments
 (0)