@@ -190,6 +190,61 @@ void main() {
190190 },
191191 );
192192
193+ testWidgets ('Transaction detail page refreshes when txid changes' , (
194+ tester,
195+ ) async {
196+ final fakeWalletService = FakeWalletService (
197+ walletInfo: _testWalletInfo,
198+ transactions: _placeholderTransactions,
199+ );
200+
201+ Future <void > pumpDetail (String txid) async {
202+ await tester.pumpWidget (
203+ ProviderScope (
204+ overrides: [
205+ walletServiceProvider.overrideWithValue (fakeWalletService),
206+ ],
207+ child: MaterialApp (
208+ home: TransactionDetailPage (
209+ key: const ValueKey ('detail-page' ),
210+ txid: txid,
211+ ),
212+ ),
213+ ),
214+ );
215+ }
216+
217+ await pumpDetail (_placeholderTransactions.first.txid);
218+ await tester.pumpAndSettle ();
219+
220+ expect (
221+ find.text (
222+ '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd' ,
223+ ),
224+ findsOneWidget,
225+ );
226+ expect (find.text ('January 2 2024 03:04' ), findsOneWidget);
227+
228+ await pumpDetail (_placeholderTransactions.last.txid);
229+ await tester.pumpAndSettle ();
230+
231+ expect (
232+ find.text (
233+ 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890' ,
234+ ),
235+ findsOneWidget,
236+ );
237+ expect (find.text ('-1600 sat' ), findsNWidgets (2 ));
238+ expect (find.text ('pending' ), findsNWidgets (2 ));
239+ expect (
240+ find.text (
241+ '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd' ,
242+ ),
243+ findsNothing,
244+ );
245+ expect (find.text ('January 2 2024 03:04' ), findsNothing);
246+ });
247+
193248 testWidgets ('Transaction detail page handles a missing tx gracefully' , (
194249 tester,
195250 ) async {
0 commit comments