diff options
| author | Adam Soltys <[email protected]> | 2026-10-18 09:27:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-18 09:27:09 -0700 |
| commit | aaebbd5d51e0e149c36975122dd0ae59e6c011bb (patch) | |
| tree | e3997c172c563fa0a29012ac18159d2be144d151 /tools/call-test.js | |
| parent | bfa52c7a2cf1cc06455536d9a6676b0003a30452 (diff) | |
| download | coinosv3-aaebbd5d51e0e149c36975122dd0ae59e6c011bb.tar.gz coinosv3-aaebbd5d51e0e149c36975122dd0ae59e6c011bb.zip | |
Call history: each call is a row in its conversation — Outgoing / Incoming video call · 4:12, Missed, Declined, No answer, Cancelled, Busy — a tap calls back. Kept like a message and sent to our own inbox (kind 1405, gift-wrapped to us alone) so our other devices list it; a call logged by two of our devices shows once, by its call-id. A call that rang while the app was shut and went unanswered is a missed call when it next opens.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools/call-test.js')
| -rw-r--r-- | tools/call-test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/call-test.js b/tools/call-test.js index 96271fb..2958187 100644 --- a/tools/call-test.js +++ b/tools/call-test.js @@ -121,6 +121,10 @@ try { check('hanging up ends it here', await waitFor(A.page, () => /call ended/i.test(document.querySelector('.call-overlay')?.innerText || ''), 3000)); check('...and there', await waitFor(B.page, () => /call ended/i.test(document.querySelector('.call-overlay')?.innerText || ''), 10000)); check('...the cameras let go', await waitFor(A.page, () => !document.querySelector('.call-overlay'), 6000) && await waitFor(B.page, () => !document.querySelector('.call-overlay'), 6000)); + const logs = (page) => page.evaluate(() => [...document.querySelectorAll('.chat-row.call-log')].map((r) => r.innerText.replace(/\s+/g, ' ').trim())); + check('the call is in the caller\'s conversation: outgoing, how long', await waitFor(A.page, () => [...document.querySelectorAll('.chat-row.call-log')].some((r) => /Outgoing video call · \d+:\d\d/.test(r.innerText)), 5000), JSON.stringify(await logs(A.page))); + await openDm(B, A.pk); + check('...and in the callee\'s: incoming', await waitFor(B.page, () => [...document.querySelectorAll('.chat-row.call-log')].some((r) => /Incoming video call · \d+:\d\d/.test(r.innerText)), 5000), JSON.stringify(await logs(B.page))); console.log('\n[declined]'); await A.page.evaluate(() => document.querySelector('.call-start[data-call="voice"]').click()); @@ -128,6 +132,12 @@ try { await B.page.evaluate(() => document.querySelector('.call-decline').click()); check('declined: the caller is told', await waitFor(A.page, () => /declined/i.test(document.querySelector('.call-overlay')?.innerText || ''), 10000)); await waitFor(A.page, () => !document.querySelector('.call-overlay'), 6000); + check('...and it\'s logged so on both sides', await waitFor(A.page, () => [...document.querySelectorAll('.chat-row.call-log')].some((r) => /Outgoing voice call · Declined/.test(r.innerText)), 5000) + && await waitFor(B.page, () => [...document.querySelectorAll('.chat-row.call-log.missed')].some((r) => /Declined voice call/.test(r.innerText)), 5000), JSON.stringify([await logs(A.page), await logs(B.page)])); + await B.page.evaluate(() => document.querySelector('.chat-row.call-log .call-log-pill').click()); + check('a tap on a logged call calls back', await waitFor(A.page, () => !!document.querySelector('.call-overlay .call-accept'), 15000)); + await A.page.evaluate(() => document.querySelector('.call-decline').click()); + await waitFor(B.page, () => !document.querySelector('.call-overlay'), 8000); console.log('\n[a remote signer\'s way: the candidates inside the offer and answer]'); for (const w of [A, B]) await w.page.evaluate(() => localStorage.setItem('coinos-call-trickle', '0')); @@ -152,6 +162,7 @@ try { await sleep(5000); check('someone Bob neither follows nor wrote to doesn\'t ring him', !(await B.page.evaluate(() => !!document.querySelector('.call-overlay')))); await C.page.evaluate(() => document.querySelector('.call-hang')?.click()); + check('...the caller who gave up has it as cancelled', await waitFor(C.page, () => [...document.querySelectorAll('.chat-row.call-log')].some((r) => /Cancelled voice call/.test(r.innerText)), 6000)); for (const w of [A, B, C]) check(w.name + ': no page errors', !w.page.errs.length, w.page.errs.join(' | ')); } catch (e) { console.error(e); ok = false; } finally { await browser.close(); server.stop(true); |
