Changeset c4b24b3 in Klonkt for test/thread.test.js
- Timestamp:
- 08/08/2026 01:08:33 AM (5 weeks ago)
- Branches:
- main
- Children:
- 9c9a3d9
- Parents:
- 4f97b70
- File:
-
- 1 edited
-
test/thread.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/thread.test.js
r4f97b70 rc4b24b3 91 91 }); 92 92 93 test('de Mastodon-vorm: first is een lege inline-pagina, de antwoorden staan op next', async () => { 94 // Precies wat Mastodon serveert en wat Barts melding (8-8) verklaarde: wie 95 // alleen de eerste pagina leest, ziet op elke Mastodon-post een leeg gesprek. 96 const MPOST = 'https://203.0.113.50/notes/masto-1'; 97 const vorige = globalThis.fetch; 98 globalThis.fetch = async (url) => { 99 const u = String(url); 100 const json = (o) => new Response(JSON.stringify(o), { status: 200, headers: { 'content-type': 'application/activity+json' } }); 101 if (u === MPOST) return json({ 102 id: MPOST, type: 'Note', attributedTo: TANTE, content: '<p>toot</p>', 103 replies: { 104 id: `${MPOST}/replies`, type: 'Collection', 105 first: { type: 'CollectionPage', items: [], next: `${MPOST}/replies?page=true` }, 106 }, 107 }); 108 if (u === `${MPOST}/replies?page=true`) return json({ 109 type: 'CollectionPage', 110 items: [{ id: `${MPOST}/r1`, type: 'Note', attributedTo: TANTE, inReplyTo: MPOST, content: '<p>eerste echte antwoord</p>', published: '2026-08-02T10:00:00Z' }], 111 }); 112 return vorige(url); 113 }; 114 const uit = await AP.getThread('kind', MPOST, { isWard: false }); 115 globalThis.fetch = vorige; 116 assert.equal(uit.notes.length, 1, 'het antwoord op de next-pagina is gevonden'); 117 assert.ok(uit.notes[0].content.includes('eerste echte antwoord')); 118 }); 119 93 120 test('de tweede lezing komt uit het geheugen, niet van het netwerk', async () => { 94 121 let calls = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)