File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 96
96
97
97
(ent/entry-balanced? ds group-name entry-transformed))))
98
98
99
- ; ; TODO - test unbalanced
100
- ; ; TODO - test non-existant accounts
101
- ; ; TODO - a bigger entry example
102
- ; ; TODO - test with "find-corresponding-account-byid"
103
- ; ; TODO - test that entry gets into the correct group
104
-
105
99
(defspec test-add-entry
106
100
10
107
101
(prop/for-all [_ gen/int]
126
120
(= '(:db :journal )
127
121
(sort (keys (first (ent/add-entry ds group-name entry))))))))
128
122
129
- #_ (defspec test-list-entry
123
+ (defspec test-list-entry
130
124
10
131
125
(prop/for-all [_ gen/int]
132
126
147
141
{:type :debit
148
142
:amount 1600
149
143
:account " widgets" }]}
144
+ _ (ent/add-entry ds group-name entry)
150
145
151
146
result (ent/list-entries ds group-name)]
152
147
153
- (= result
154
- #{{:content #{{:type :credit , :amount 2600.0 }
155
- {:type :debit , :amount 1600.0 }
156
- {:type :debit , :amount 1000.0 }},
157
- :date edate}}))))
148
+
149
+
150
+ (and (= 1 (count result))
151
+
152
+ (= '(:content :date )
153
+ (sort (keys (first result))))
154
+
155
+ (= (sort-by :type (-> result first :content ))
156
+ (sort-by :type #{{:type :credit , :amount 2600.0 }
157
+ {:type :debit , :amount 1600.0 }
158
+ {:type :debit , :amount 1000.0 }}))))))
158
159
159
160
160
161
(comment
You can’t perform that action at this time.
0 commit comments