From 450cf3715a2ba7b3af18b926e84df4b7f793840a Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Jul 2026 08:17:51 +0200 Subject: [PATCH] Test that nested Live 10 Simpler devices are serialized with IDs --- tests/ableton-hybrid.test.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/ableton-hybrid.test.ts b/tests/ableton-hybrid.test.ts index c9351a0..812ccec 100644 --- a/tests/ableton-hybrid.test.ts +++ b/tests/ableton-hybrid.test.ts @@ -1,5 +1,7 @@ import assert from 'node:assert/strict'; import test from 'node:test'; +import { gunzipSync } from 'node:zlib'; +import { createServer } from 'vite'; import { assignDeviceListIds } from '../src/lib/exporters/ableton/builders'; import abletonTransformer, { AblTrack, getDrumRackMidiNote } from '../src/lib/transformers/ableton'; import { @@ -154,6 +156,37 @@ test('assigns IDs to every device-list member, including nested rack devices', ( assert.equal(devices[1].AutoFilter['@Id'], 1); }); +test('serializes every nested Live 10 Simpler as an identified list member', async () => { + const server = await createServer({ + server: { middlewareMode: true }, + appType: 'custom', + mode: 'production', + }); + + try { + const { buildProject } = await server.ssrLoadModule( + '/src/lib/exporters/ableton/builders.ts', + ); + const generated = await buildProject(project(), { + abletonVersion: '10', + includeArchivedSamples: true, + clips: false, + groupTracks: true, + sendEffects: false, + allScenes: true, + }); + const xml = gunzipSync(Buffer.from(generated)).toString('utf8'); + const simplerTags = [...xml.matchAll(/]*)?>/g)].map( + (match) => match[0], + ); + + assert.ok(simplerTags.length > 0); + assert.ok(simplerTags.every((tag) => /\sId="\d+"/.test(tag))); + } finally { + await server.close(); + } +}); + test('automatically builds a per-group rack without flattening chromatic pads', () => { const result = abletonTransformer(project(), { includeArchivedSamples: true,