File tree 5 files changed +9
-19
lines changed
5 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,9 @@ lint-fix: ##@test Run code style checks and fix issues
266
266
267
267
test : export TARGET := clojure
268
268
test : # #@test Run tests once in NodeJS
269
- echo 0
269
+ yarn shadow-cljs compile mocks && \
270
+ yarn shadow-cljs compile test && \
271
+ node --require ./test-resources/override.js target/test/test.js
270
272
271
273
coverage : # #@test Run tests once in NodeJS generating coverage
272
274
@scripts/run-coverage.sh
Original file line number Diff line number Diff line change 41
41
(is (= {:type :datemark
42
42
:value " Dec 31, 1999" } d2)))))
43
43
44
- (deftest active-chats-test
45
- (with-redefs [gfycat/generate-gfy (constantly " generated" )
46
- identicon/identicon (constantly " generated" )]
47
- (let [active-chat-1 {:is-active true :chat-id " 1" }
48
- active-chat-2 {:is-active true :chat-id " 2" }
49
- chats {" 1" active-chat-1
50
- " 2" active-chat-2
51
- " 3" {:is-active false :chat-id " 3" }}]
52
- (testing " it returns only chats with is-active"
53
- (is (= #{" 1" " 2" }
54
- (set (keys (db/active-chats {} chats {})))))))))
55
-
56
44
(deftest add-gaps
57
45
(testing " empty state"
58
46
(is (empty?
Original file line number Diff line number Diff line change 28
28
29
29
(fx/defn rebuild-message-list
30
30
[{:keys [db]} chat-id]
31
- {:db (assoc-in db [:chats chat-id :message-list ]
31
+ {:db (assoc-in db [:message-lists chat-id]
32
32
(message-list/add-many nil (vals (get-in db [:messages chat-id]))))})
33
33
34
34
(fx/defn hidden-message-marked-as-seen
Original file line number Diff line number Diff line change 270
270
(testing " Deleting message deletes it along with all references"
271
271
(is (= '(0 )
272
272
(keys (get-in fx1 [:db :messages " chat-id" ]))))
273
+ (do
274
+ (println fx1))
273
275
(is (= [{:one-to-one? false
274
276
:message-id 0
275
277
:whisper-timestamp 0
290
292
(models.message-list/->seq
291
293
(get-in fx1 [:db :message-lists " chat-id" ]))))
292
294
(is (= {}
293
- (get-in fx2 [:db :message-lists " chat-id" ])))
295
+ (get-in fx2 [:db :messages " chat-id" ])))
294
296
(is (= nil
295
297
(get-in fx2 [:db :message-lists " chat-id" ])))))))
Original file line number Diff line number Diff line change 5
5
(deftest ->to-rpc
6
6
(let [chat {:public? false
7
7
:group-chat true
8
- :message-list []
9
8
:color " color"
10
9
:contacts #{" a" " b" " c" " d" }
11
10
:last-clock-value 10
15
14
:membership-update-events :events
16
15
:unviewed-messages-count 2
17
16
:is-active true
18
- :pagination-info {}
19
17
:chat-id " chat-id"
20
18
:loaded-unviewed-messages-ids []
21
- :timestamp 2
22
- :messages-initialized? true }
19
+ :timestamp 2 }
23
20
expected-chat {:id " chat-id"
24
21
:color " color"
25
22
:name " name"
71
68
expected-chat {:public? false
72
69
:group-chat true
73
70
:color " color"
71
+ :chat-name " name"
74
72
:contacts #{" a" " b" " c" " d" }
75
73
:last-clock-value 10
76
74
:last-message nil
You can’t perform that action at this time.
0 commit comments