Changeset 0a93c15 in Klonkt for test/polls.test.js
- Timestamp:
- 07/04/2026 05:44:17 PM (2 months ago)
- Branches:
- main
- Children:
- da71f9d
- Parents:
- 6ec0433
- File:
-
- 1 edited
-
test/polls.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/polls.test.js
r6ec0433 r0a93c15 42 42 assert.ok(note.endTime, 'has an endTime'); 43 43 assert.ok(!('attachment' in note), 'no media on a poll (mutually exclusive on Mastodon)'); 44 }); 45 46 test('a poll KEEPS its cover in note.image (feeds show it; Mastodon ignores it)', () => { 47 // An embed/music poll suppresses image attachments (so Mastodon shows the 48 // player/embed card) and carries the cover in note.image instead — exactly 49 // the case that lost its cover when applyPollToNote deleted image. 50 const withCover = { 51 ...singlePoll, id: 'p1', slug: 'fav', 52 content: '<p>Pick one</p> [[embed:https://www.youtube.com/watch?v=abcdefghijk]]', 53 cover_image_url: '/media/post-images/cover.webp', cover_alt: 'Album art', 54 }; 55 const note = AP.buildNote(BASE, site, withCover); 56 assert.equal(note.type, 'Question', 'still a Question'); 57 assert.ok(note.image && note.image.url, 'the cover survives as note.image'); 58 assert.ok(note.image.url.endsWith('/media/post-images/cover.webp'), 'absolute cover url'); 59 assert.equal(note.image.name, 'Album art', 'alt text kept'); 60 assert.ok(!('attachment' in note), 'still no media attachment on a poll'); 44 61 }); 45 62
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)