aboutsummaryrefslogtreecommitdiffstats
path: root/test/fixtures.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixtures.js')
-rw-r--r--test/fixtures.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/fixtures.js b/test/fixtures.js
new file mode 100644
index 0000000..141b43b
--- /dev/null
+++ b/test/fixtures.js
@@ -0,0 +1,30 @@
+// Sample serialized messages (the shape of src/serialize.js).
+const base = {
+ fromMe: false, author: null, hasMedia: false, media: null, hasQuotedMsg: false, quotedStanzaId: null,
+ quotedParticipant: null, isForwarded: false, isStarred: false, isStatus: false, ack: 1, mentionedIds: [], links: [],
+};
+
+export const messages = [
+ {
+ ...base,
+ id: 'false_5491122334455@c.us_3EB0AAA1', stanzaId: '3EB0AAA1', chatId: '5491122334455@c.us', chatName: 'Juan Pérez',
+ from: '5491122334455@c.us', to: '5491199999999@c.us', sender: '5491122334455@c.us', senderName: 'Juan Pérez',
+ timestamp: 1789500000, date: '2026-09-15T19:20:00.000Z', type: 'chat',
+ body: 'Hola! ¿venís mañana? 🎉\nFrom here on, una línea muy larga ' + 'ñ'.repeat(120),
+ },
+ {
+ ...base,
+ id: 'true_5491122334455@c.us_3EB0BBB2', stanzaId: '3EB0BBB2', chatId: '5491122334455@c.us', chatName: 'Juan Pérez',
+ fromMe: true, from: '5491199999999@c.us', to: '5491122334455@c.us', sender: '5491199999999@c.us', senderName: 'Elvis',
+ timestamp: 1789500060, date: '2026-09-15T19:21:00.000Z', type: 'image', body: 'la foto',
+ hasMedia: true, hasQuotedMsg: true, quotedStanzaId: '3EB0AAA1',
+ media: { mimetype: 'image/png', filename: 'captura año.png', size: 70, data: Buffer.from('PNGDATA'.repeat(10)).toString('base64') },
+ },
+ {
+ ...base,
+ id: 'false_120363000000@g.us_3EB0CCC3_5491133334444@c.us', stanzaId: '3EB0CCC3', chatId: '120363000000@g.us',
+ chatName: 'Familia', from: '120363000000@g.us', to: '5491199999999@c.us', author: '5491133334444@c.us',
+ sender: '5491133334444@c.us', senderName: null, timestamp: 1789500120, date: '2026-09-15T19:22:00.000Z',
+ type: 'document', body: '', hasMedia: true, media: { mimetype: 'application/pdf', filename: 'boleta.pdf', size: 20480 },
+ },
+];