From 07dfda65104bd0d187694bd18f10a84d5f574ffc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Jul 2026 08:55:12 +0200 Subject: [PATCH] Test: Check pad envelope preservation before group automation --- tests/ableton-automation.test.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/ableton-automation.test.ts b/tests/ableton-automation.test.ts index 3939f94..7b2e5a7 100644 --- a/tests/ableton-automation.test.ts +++ b/tests/ableton-automation.test.ts @@ -114,3 +114,30 @@ test('uses each Simpler target duration and One-Shot release direction', () => { assert.equal(envelopes[0].Automation.Events.FloatEvent[2]['@Value'], 1500); assert.equal(envelopes[1].Automation.Events.FloatEvent[2]['@Value'], 1000); }); + +test('preserves the pad envelope before group automation when the static group value is absent', () => { + const pattern = { + ...occurrence, + faderParams: { ...faderParams, [FaderParam.REL]: -1 }, + }; + const envelopes = buildClipEnvelopes( + pattern, + { + [FaderParam.REL]: [ + { + session: 23000, + soundLength: 4, + maxValue: 2000, + invertValue: true, + staticValue: 321, + }, + ], + }, + track, + false, + ); + + assert.equal(envelopes[0].Automation.Events.FloatEvent[0]['@Value'], 321); + assert.equal(envelopes[0].Automation.Events.FloatEvent[1]['@Value'], 321); + assert.equal(envelopes[0].Automation.Events.FloatEvent[2]['@Value'], 1000); +});