@@ -131,7 +131,7 @@ def has_text():
131131
132132
133133def btc_text_to_sats (text ):
134- match = re .search (r"([0-9]+(?:\.[0-9]+)?)" , text .replace ("," , "" ))
134+ match = re .search (r"(-? [0-9]+(?:\.[0-9]+)?)" , text .replace ("," , "" ))
135135 if match is None :
136136 raise AssertionError (f"Could not parse BTC amount from { text !r} " )
137137 try :
@@ -220,7 +220,7 @@ def run_test(*, save_screenshots=False, screenshot_root=None):
220220 )
221221 checkpoints .checkpoint ("gui wallet funded" , gui )
222222
223- gui .click ("desktopWalletsSendTab " )
223+ gui .click ("sendTabButton " )
224224 gui .wait_for_page ("sendPage" , timeout_ms = 10000 )
225225 checkpoints .checkpoint ("send page opened" , gui )
226226
@@ -318,9 +318,31 @@ def run_test(*, save_screenshots=False, screenshot_root=None):
318318 )
319319 checkpoints .checkpoint ("broadcast fee verified" , gui )
320320
321+ gui .wait_for_page ("sendResultPopup" , timeout_ms = 10000 )
322+ gui .click ("sendResultDoneButton" )
323+ gui .wait_for_property ("activityTabButton" , "visible" , True , timeout_ms = 10000 )
324+ gui .click ("activityTabButton" )
325+ gui .wait_for_property ("activitySearchToggle" , "visible" , True , timeout_ms = 10000 )
326+ gui .click ("activitySearchToggle" )
327+ gui .wait_for_property ("activitySearchToggle" , "checked" , True , timeout_ms = 5000 )
328+ gui .click ("activityTypeFilterButton" )
329+ gui .click ("activityTypeSent" )
330+ gui .wait_for_property ("activityFilterProxyModel" , "count" , 1 , timeout_ms = 20000 )
331+ activity_amount_text = gui .get_list_item_property ("activityListView" , 0 , "amount" )
332+ activity_amount_sats = amount_text_to_sats (activity_amount_text )
333+ assert activity_amount_text .startswith ("-" ), (
334+ f"Expected sent Activity amount to display with a minus sign, got { activity_amount_text !r} "
335+ )
336+ assert activity_amount_sats < 0 , (
337+ f"Expected sent Activity amount to parse as negative sats, got "
338+ f"{ activity_amount_text !r} ({ activity_amount_sats } sats)"
339+ )
340+ checkpoints .checkpoint ("sent Activity amount sign verified" , gui )
341+
321342 print (
322343 "Send flow passed: preview totals were correct with include-fee off and on, "
323- "and the broadcast fee matched the subtract-fee preview."
344+ "the broadcast fee matched the subtract-fee preview, and Activity showed the "
345+ "sent amount as negative."
324346 )
325347 return 0
326348 except Exception as err : # noqa: BLE001 - preserve failure context for functional test output
0 commit comments