fix(manager): align frontend and backend field contracts

This commit is contained in:
Tyke Chen
2026-07-24 10:21:05 +08:00
parent 27e57631a7
commit 18e5c47a06
20 changed files with 455 additions and 64 deletions
@@ -0,0 +1,17 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
const timbreApiSource = await readFile(
new URL('../src/apis/module/timbre.js', import.meta.url),
'utf8',
);
test('timbre update sends the current sort value to the backend', () => {
const updateStart = timbreApiSource.indexOf('updateVoice(params, callback)');
assert.notEqual(updateStart, -1);
const updateSource = timbreApiSource.slice(updateStart);
assert.match(updateSource, /\.method\('PUT'\)/);
assert.match(updateSource, /sort:\s*params\.sort/);
});