Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 18:15 UTC
test(trace): verify both statement note and source account mapping in Tk search
davoodmehraban89 committed
Nov 1, 2026 at 00:07 UTC
e6dcd334ab00b991955ac44d8bcc6d9ea2d468c3
1 file changed
+15
-8
backend/tests/test_desktop_five_statement.py
+15
-8
@@ -233,6 +233,7 @@ def test_native_window_shows_real_successful_five_statement_result(tmp_path):
233
+ len(window.controller.result.cash_flow.cash_flow_lines)
234
+ len(window.controller.result.cash_flow.account_reconciliations)
235
+ len(window.controller.result.trial_balance.accounts)
236
+ + len(window.controller.result.mapping_coverage.mappings)
237
)
238
assert len(window._detail_rows) == expected_details
239
assert any(row.item == "Revenue" for row in window._detail_rows)
@@ -248,10 +249,12 @@ def test_native_window_shows_real_successful_five_statement_result(tmp_path):
249
break
250
time.sleep(0.01)
251
assert not window._filtering
251
- assert len(window.detail_tree.get_children()) == 1
252
- assert window.detail_tree.item(
253
- window.detail_tree.get_children()[0], "values",
254
- )[1] == "Revenue"
252
+ filtered = [
253
+ window.detail_tree.item(row, "values")
254
+ for row in window.detail_tree.get_children()
255
+ ]
256
+ assert len(filtered) == 2
257
+ assert {row[1] for row in filtered} == {"Revenue", "حساب REV / Revenue"}
258
window.clear_button.invoke()
259
assert not window.outcome_tree.get_children()
260
assert not window.figures_tree.get_children()
@@ -311,8 +314,10 @@ def test_new_detail_query_supersedes_inflight_search_and_ignores_stale_reply(
314
time.sleep(0.01)
315
assert not window._filtering
316
rows = window.detail_tree.get_children()
314
- assert len(rows) == 1
315
- assert window.detail_tree.item(rows[0], "values")[1] == "Revenue"
317
+ assert len(rows) == 2
318
+ assert {window.detail_tree.item(row, "values")[1] for row in rows} == {
319
+ "Revenue", "حساب REV / Revenue",
320
+ }
321
322
release_old.set()
323
for _ in range(30):
@@ -322,8 +327,10 @@ def test_new_detail_query_supersedes_inflight_search_and_ignores_stale_reply(
327
# in the pending event queue after the newer search finishes.
328
assert window._filter_events.empty()
329
rows = window.detail_tree.get_children()
325
- assert len(rows) == 1
326
- assert window.detail_tree.item(rows[0], "values")[1] == "Revenue"
330
+ assert len(rows) == 2
331
+ assert {window.detail_tree.item(row, "values")[1] for row in rows} == {
332
+ "Revenue", "حساب REV / Revenue",
333
+ }
334
window.clear_button.invoke()
335
assert not window.detail_tree.get_children()
336
assert not window._detail_rows