Changeset 952baf3 in Klonkt for test/messages.test.js
- Timestamp:
- 08/07/2026 05:15:52 PM (5 weeks ago)
- Branches:
- main
- Children:
- ba76bf5
- Parents:
- f85b2c3 (diff), 0d5bd2c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
test/messages.test.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
test/messages.test.js
rf85b2c3 r952baf3 2 2 // in één stroom, groepeert opeenvolgende likes/boosts op dezelfde post, en geeft 3 3 // visibility door (voor de privé-badge). Besluit Robin+Bart 2026-07-16. 4 // 5 // Sinds Berichten gesprekken toont vouwen antwoorden, mentions en je eigen 6 // verzonden berichten samen tot draden (zie messages-conversations.test.js voor 7 // de groepeerlogica zelf); likes, boosts en follows blijven losse regels. 4 8 // 5 9 // Run: npm test (= node --test) … … 42 46 const msgs = AP.getMessages('me', 50); 43 47 44 test('eigen outbound reply zit als "sent" in de stroom (nieuwste eerst)', () => { 45 const sent = msgs.find((m) => m.type === 'sent'); 48 test('eigen outbound reply en het ontvangen antwoord staan in EEN draad', () => { 49 const thread = msgs.find((m) => m.type === 'thread'); 50 assert.ok(thread, 'draad ontbreekt'); 51 assert.equal(msgs[0], thread, 'de draad met het nieuwste bericht hoort bovenaan'); 52 const sent = thread.messages.find((m) => m.type === 'sent'); 46 53 assert.ok(sent, 'sent-item ontbreekt'); 47 54 assert.equal(sent.outboxId, 'out1'); 48 55 assert.equal(sent.to_handle, '@dana@r.test'); 49 assert.equal(msgs[0].type, 'sent', 'nieuwste item hoort bovenaan'); 56 // Hier gaat het om: Dana's antwoord en het jouwe zaten in aparte chips 57 // (Gesprekken en Verzonden) en staan nu op volgorde in dezelfde draad. 58 assert.deepEqual(thread.messages.map((m) => m.type), ['reply', 'sent']); 59 assert.equal(thread.post.slug, 'mijn-post'); 50 60 }); 51 61 … … 58 68 59 69 test('privé-reply draagt visibility voor de badge en heeft post-context', () => { 60 const reply = msgs.find((m) => m.type === 'reply'); 70 const thread = msgs.find((m) => m.type === 'thread'); 71 const reply = thread.messages.find((m) => m.type === 'reply'); 61 72 assert.equal(reply.visibility, 'direct'); 62 73 assert.equal(reply.post_slug, 'mijn-post'); 63 74 assert.equal(reply.post_title, 'Mijn post'); 75 // De context hangt ook aan de draad zelf: die voedt de link in de kop. 76 assert.deepEqual(thread.post, { slug: 'mijn-post', title: 'Mijn post' }); 64 77 }); 65 78
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)