about summary refs log tree commit diff
path: root/src/state/messages/__tests__/client.test.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-05-01 12:14:41 -0500
committerGitHub <noreply@github.com>2024-05-01 10:14:41 -0700
commit538ca8dff16e9973a0fd4c310dd89cfe05536f6b (patch)
tree24dc6be1907cdc834d6f3fe1a709025fb4fd43d7 /src/state/messages/__tests__/client.test.ts
parentd61b366b26dbe8b30ee30e121a5b1aa3edea356b (diff)
downloadvoidsky-538ca8dff16e9973a0fd4c310dd89cfe05536f6b.tar.zst
[Clipclops] 2 Clipped 2 Clopped (#3796)
* Add new pkg

* copy queries over to new file

* useConvoQuery

* useListConvos

* Use useListConvos

* extract useConvoQuery

* useGetConvoForMembers

* Delete unused

* exract useListConvos

* Replace imports

* Messages/List/index.tsx

* extract getconvoformembers

* MessageItem

* delete chatLog and rename query.ts

* Update import

* Clipclop service (#3794)

* Add Chat service

* Better handle deletions

* Rollback unneeded changes

* Better insertion order

* Use clipclops

* don't show FAB if error

* clean up imports

* Update Convo service

* Remove temp files

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/state/messages/__tests__/client.test.ts')
-rw-r--r--src/state/messages/__tests__/client.test.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/state/messages/__tests__/client.test.ts b/src/state/messages/__tests__/client.test.ts
new file mode 100644
index 000000000..cab1d9021
--- /dev/null
+++ b/src/state/messages/__tests__/client.test.ts
@@ -0,0 +1,38 @@
+import {describe, it} from '@jest/globals'
+
+describe(`#/state/dms/client`, () => {
+  describe(`ChatsService`, () => {
+    describe(`unread count`, () => {
+      it.todo(`marks a chat as read, decrements total unread count`)
+    })
+
+    describe(`log processing`, () => {
+      /*
+       * We receive a new chat log AND messages for it in the same batch. We
+       * need to first initialize the chat, then process the received logs.
+       */
+      describe(`handles new chats and subsequent messages received in same log batch`, () => {
+        it.todo(`receives new chat and messages`)
+        it.todo(
+          `receives new chat, new messages come in while still initializing new chat`,
+        )
+      })
+    })
+
+    describe(`reset state`, () => {
+      it.todo(`after period of inactivity, rehydrates entirely fresh state`)
+    })
+  })
+
+  describe(`ChatService`, () => {
+    describe(`history fetching`, () => {
+      it.todo(`fetches initial chat history`)
+      it.todo(`fetches additional chat history`)
+      it.todo(`handles history fetch failure`)
+    })
+
+    describe(`optimistic updates`, () => {
+      it.todo(`adds sending messages`)
+    })
+  })
+})