From 185d9c71df1a82744b0a8d15444bc16e6e8903fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 11 Aug 2022 10:51:13 +0100 Subject: [PATCH] Expect correct arguments for storing meta doc --- tests/chat-messages-spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/chat-messages-spec.js b/tests/chat-messages-spec.js index 847830e..3d95ba1 100644 --- a/tests/chat-messages-spec.js +++ b/tests/chat-messages-spec.js @@ -89,7 +89,7 @@ describe('ChatMessages', function () { before(function() { sandbox.stub(archive.client, 'getObject').withArgs(archive.metaPath) .returns({ - '@id': `chat-messages/irc.libera.chat/channels/kosmos/meta`, + '@id': archive.metaPath, '@type': 'ChatChannelMeta', first: '2021/01/01', last: '2022/08/10' }) @@ -98,7 +98,13 @@ describe('ChatMessages', function () { it('stores a new archive', async function () { await archive._updateArchiveMetaDocument(); - sandbox.assert.calledOnce(archive.client.storeObject); + sandbox.assert.calledWithMatch( + archive.client.storeObject, + 'daily-archive-meta', archive.metaPath, { + '@id': archive.metaPath, '@type': 'ChatChannelMeta', + first: '2021/01/01', last: '2022/08/11' + } + ); }); after(function() { sandbox.restore() });