From a200bab8bd6a3e3b5a6b75fddb6d834b4fa96433 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sun, 21 Apr 2024 13:26:55 +0200 Subject: [PATCH] test/chan: getFilteredClone has more fields than the test thinks The codebase shoves various things into channel objects to transmit them for things like channel lists etc. This however means that the type does contains the fields and needs to export them. We should clean up the events so that we can get rid of all that. But for now, we adapt the test expectation to reality. --- test/models/chan.ts | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/test/models/chan.ts b/test/models/chan.ts index ad156789..97a7dfcc 100644 --- a/test/models/chan.ts +++ b/test/models/chan.ts @@ -198,23 +198,26 @@ describe("Chan", function () { it("should keep necessary properties", function () { const chan = new Chan(); - expect(chan.getFilteredClone()) - .to.be.an("object") - .that.has.all.keys( - "firstUnread", - "highlight", - "id", - "key", - "messages", - "muted", - "totalMessages", - "name", - "state", - "topic", - "type", - "unread", - "users" - ); + expect(chan.getFilteredClone()).to.be.an("object").that.has.all.keys( + "firstUnread", + "highlight", + "id", + "key", + "messages", + "muted", + "totalMessages", + "name", + "state", + "topic", + "type", + "unread", + "users", + // the following are there in special cases, need to fix the types + "num_users", + "special", + "closed", + "data" + ); }); it("should send only last message for non active channel", function () {