Skip to content

Commit 1e28abf

Browse files
committed
fix: update test expectations for email-text-tools 2.3.5+ behavior
The email-text-tools package version 2.3.5 introduced "better newline preservation" in HTML-to-text conversion, which now adds trailing newlines to text content. Update test expectations to match this behavior change from the dependency upgrade in d27db59.
1 parent 2c46822 commit 1e28abf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

β€Žtest/api-test.jsβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ test('API tests', async t => {
271271

272272
await t.test('retrieve message text', async () => {
273273
const response = await server.get(`/v1/account/${defaultAccountId}/text/${message2.text.id}?textType=*`).expect(200);
274-
assert.deepEqual(response.body, { plain: 'Hello world! πŸ™ƒ', html: '<b>Hello world! πŸ™ƒ</b>', hasMore: false });
274+
// Note: email-text-tools 2.3.5+ adds trailing newlines for better newline preservation
275+
assert.deepEqual(response.body, { plain: 'Hello world! πŸ™ƒ\n', html: '<b>Hello world! πŸ™ƒ</b>\n', hasMore: false });
275276
});
276277

277278
await t.test('download attachment', async () => {
@@ -293,8 +294,9 @@ test('API tests', async t => {
293294
assert.strictEqual(message.id, message2.id);
294295
assert.strictEqual(message.subject, 'Test message 🀣');
295296
assert.strictEqual(message.messageSpecialUse, '\\Inbox');
296-
assert.strictEqual(message.text.plain, 'Hello world! πŸ™ƒ');
297-
assert.strictEqual(message.text.html, '<b>Hello world! πŸ™ƒ</b>');
297+
// Note: email-text-tools 2.3.5+ adds trailing newlines for better newline preservation
298+
assert.strictEqual(message.text.plain, 'Hello world! πŸ™ƒ\n');
299+
assert.strictEqual(message.text.html, '<b>Hello world! πŸ™ƒ</b>\n');
298300
assert.ok(!message.text.webSafe);
299301
});
300302

@@ -306,7 +308,8 @@ test('API tests', async t => {
306308
assert.strictEqual(message.id, message2.id);
307309
assert.strictEqual(message.subject, 'Test message 🀣');
308310
assert.strictEqual(message.messageSpecialUse, '\\Inbox');
309-
assert.strictEqual(message.text.plain, 'Hello world! πŸ™ƒ');
311+
// Note: email-text-tools 2.3.5+ adds trailing newlines for better newline preservation
312+
assert.strictEqual(message.text.plain, 'Hello world! πŸ™ƒ\n');
310313
assert.strictEqual(message.text.html, '<div style="overflow: auto;"><b>Hello world! πŸ™ƒ</b></div>');
311314
assert.strictEqual(message.text.webSafe, true);
312315
});

0 commit comments

Comments
Β (0)