test(ui): leave songs without ReplayGain tags unaffected by the pre-amp

Signed-off-by: junkerderprovinz <jdp@braethoria.com>
This commit is contained in:
junkerderprovinz 2026-10-09 20:55:45 +02:00
parent df6ec04c44
commit f2bdc8c111

View File

@ -56,6 +56,17 @@ describe('calculateGain', () => {
expect(result).toBe(1)
})
it.each(['album', 'track'])(
'does not apply the pre-amp in %s mode to a song without gain tags',
(gainMode) => {
const result = calculateGain(
{ gainMode, preAmp: 6 },
{ ...nativeTrackOnlySong, rgTrackGain: null, rgTrackPeak: null },
)
expect(result).toBe(1)
},
)
it('uses track gain in track mode', () => {
const result = calculateGain({ gainMode: 'track', preAmp }, albumSong)
expect(result).toBeCloseTo(10 ** (-3 / 20))