diff options
Diffstat (limited to 'lib/project/tests/gui_state.test.mjs')
| -rw-r--r-- | lib/project/tests/gui_state.test.mjs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/project/tests/gui_state.test.mjs b/lib/project/tests/gui_state.test.mjs index 10775eb..0556a4a 100644 --- a/lib/project/tests/gui_state.test.mjs +++ b/lib/project/tests/gui_state.test.mjs @@ -1,6 +1,6 @@ import test from 'node:test'; import assert from 'node:assert/strict'; -import {parseTime, formatTime, selection, stable, matches, monitoringGain, absolutePath} from '../src/producer/web/state.js'; +import {parseTime, formatTime, selection, stable, matches, monitoringGain} from '../src/producer/web/state.js'; test('exact excerpt times work beyond four hours without wrapping', () => { assert.equal(parseTime('05:12:03.125'), 18723.125); @@ -12,11 +12,11 @@ test('exact excerpt times work beyond four hours without wrapping', () => { for (const [start, end] of [['0', '121'], ['2', '1'], ['0', '0'], ['14399', '14401']]) assert.throws(() => selection(start, end, 14400)); }); -test('preview identity includes source, exact selection and every requested setting', () => { - const snapshot = {path: 'take.wav', input_id: 'identity', start: 10, duration: 30, settings: {mp3: true, trim_silence: true, denoiser: 'none'}}; +test('preview identity includes uploaded source, exact selection and every requested setting', () => { + const snapshot = {upload_id: 'upload', input_id: 'identity', start: 10, duration: 30, settings: {mp3: true, trim_silence: true, denoiser: 'none'}}; assert.ok(matches(snapshot, structuredClone(snapshot))); assert.ok(matches(snapshot, {...snapshot, settings: {denoiser: 'none', trim_silence: true, mp3: true}})); - for (const change of [{path: 'other.wav'}, {input_id: 'changed'}, {start: 11}, {duration: 29}, {settings: {...snapshot.settings, trim_silence: false}}]) assert.equal(matches(snapshot, {...snapshot, ...change}), false); + for (const change of [{upload_id: 'other'}, {input_id: 'changed'}, {start: 11}, {duration: 29}, {settings: {...snapshot.settings, trim_silence: false}}]) assert.equal(matches(snapshot, {...snapshot, ...change}), false); assert.equal(matches(snapshot, null), false); assert.equal(stable({b: 2, a: 1}), stable({a: 1, b: 2})); }); @@ -26,6 +26,4 @@ test('monitoring is attenuation only and independent of export settings', () => assert.equal(monitoringGain(6, true), 1); assert.equal(monitoringGain(NaN, true), 1); assert.ok(Math.abs(monitoringGain(-6, true) - 0.501187) < 0.000001); - assert.equal(absolutePath('/recordings', 'delivery/master.wav'), '/recordings/delivery/master.wav'); - assert.equal(absolutePath('/', './master.wav'), '/master.wav'); }); |
