@davoodmehraban89 / Aram / commits / 7404826
Fork 0

test(desktop): verify native statement drill-down, search and reset

davoodmehraban89 committed Oct 31, 2026 at 21:40 UTC 74048263e98ac82767d5765392c79d351351fccd
1 file changed +20
backend/tests/test_desktop_five_statement.py
+20
@@ -225,9 +225,29 @@ def test_native_window_shows_real_successful_five_statement_result(tmp_path):
225 assert len(amounts) == 28
226 assert ("ترازنامه", "دارایی‌ها", "100", "پیش‌نویس قابل بررسی؛ غیررسمی") in amounts
227 assert ("سود و زیان", "سود خالص", "20", "پیش‌نویس قابل بررسی؛ غیررسمی") in amounts
228 + expected_details = (
229 + len(window.controller.result.balance_sheet.lines)
230 + + len(window.controller.result.income_statement.lines)
231 + + len(window.controller.result.equity_changes.note_movements)
232 + + len(window.controller.result.equity_changes.account_movements)
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 + )
237 + assert len(window._detail_rows) == expected_details
238 + assert any(row.item == "Revenue" for row in window._detail_rows)
239 + window.detail_filter_var.set("سود و زیان")
240 + window.detail_search_var.set("Revenue")
241 + window._apply_detail_filter()
242 + assert len(window.detail_tree.get_children()) == 1
243 + assert window.detail_tree.item(
244 + window.detail_tree.get_children()[0], "values",
245 + )[1] == "Revenue"
246 window.clear_button.invoke()
247 assert not window.outcome_tree.get_children()
248 assert not window.figures_tree.get_children()
249 + assert not window.detail_tree.get_children()
250 + assert not window._detail_rows
251 assert window.controller.result is None
252 assert str(window.run_button.cget("state")) == "disabled"
253 finally: