Spaces:
Running
Running
| import TrackMute from "./TrackMute" | |
| describe("TrackMute", () => { | |
| it("not muted by default", () => { | |
| const t = new TrackMute() | |
| expect(t.isMuted(0)).toBeFalsy() | |
| expect(t.isMuted(100)).toBeFalsy() | |
| }) | |
| it("mute", () => { | |
| const t = new TrackMute() | |
| expect(t.isMuted(0)).toBeFalsy() | |
| t.mute(0) | |
| expect(t.isMuted(0)).toBeTruthy() | |
| expect(t.shouldPlayTrack(0)).toBeFalsy() | |
| t.unmute(0) | |
| expect(t.isMuted(0)).toBeFalsy() | |
| }) | |
| it("solo", () => { | |
| const t = new TrackMute() | |
| expect(t.isSolo(0)).toBeFalsy() | |
| t.solo(0) | |
| expect(t.isSolo(0)).toBeTruthy() | |
| expect(t.isSoloMode()).toBeTruthy() | |
| expect(t.isMuted(1)).toBeTruthy() | |
| expect(t.shouldPlayTrack(0)).toBeTruthy() | |
| expect(t.shouldPlayTrack(1)).toBeFalsy() | |
| t.solo(1) | |
| expect(t.isSolo(0)).toBeTruthy() | |
| expect(t.isSolo(1)).toBeTruthy() | |
| expect(t.isSoloMode()).toBeTruthy() | |
| expect(t.isMuted(0)).toBeFalsy() | |
| expect(t.isMuted(1)).toBeFalsy() | |
| expect(t.isMuted(2)).toBeTruthy() | |
| expect(t.shouldPlayTrack(0)).toBeTruthy() | |
| expect(t.shouldPlayTrack(1)).toBeTruthy() | |
| expect(t.shouldPlayTrack(2)).toBeFalsy() | |
| t.unsolo(0) | |
| expect(t.isSolo(0)).toBeFalsy() | |
| expect(t.isSoloMode()).toBeTruthy() | |
| t.unsolo(1) | |
| expect(t.isSolo(1)).toBeFalsy() | |
| expect(t.isSoloMode()).toBeFalsy() | |
| }) | |
| }) | |