Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
23
tests/call-journal.test.mjs
Normal file
23
tests/call-journal.test.mjs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {CallJournal} from '../services/call-journal.mjs';
|
||||
test('calls survive reload, preserve direction and import acknowledgement', () => {
|
||||
const j = new CallJournal();
|
||||
j.start({path:'/1',number:'123'}, 1000,'outgoing');
|
||||
j.update([{path:'/1',state:'active'}], 2000);
|
||||
const restored = new CallJournal(JSON.parse(JSON.stringify(j.snapshot())));
|
||||
restored.update([], 5500);
|
||||
assert.equal(restored.completed[0].duration,3500);
|
||||
assert.equal(restored.completed[0].direction,'outgoing');
|
||||
restored.update([{path:'/1',state:'incoming',number:'456'}],6000);
|
||||
restored.update([],6500);
|
||||
assert.equal(restored.completed[1].duration,0);
|
||||
assert.equal(restored.completed[1].direction,'incoming');
|
||||
assert.notEqual(restored.completed[0].id,restored.completed[1].id);
|
||||
restored.acknowledge([restored.completed[0].id]);
|
||||
assert.equal(restored.completed.length,1);
|
||||
});
|
||||
test('rapid outgoing call is logged even before the first successful poll', () => {
|
||||
const j=new CallJournal();j.start({path:'/1',number:'123'},1000,'outgoing');j.update([],1100);
|
||||
assert.equal(j.completed.length,1);assert.equal(j.completed[0].duration,0);
|
||||
});
|
||||
Loading…
Reference in a new issue