Test that nested Live 10 Simpler devices are serialized with IDs
This commit is contained in:
@@ -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(/<OriginalSimpler(?:\s[^>]*)?>/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,
|
||||
|
||||
Reference in New Issue
Block a user