Skip to content

Conversation

Copy link

Copilot AI commented Jan 13, 2026

The existing test for refreshOverdueNextPayments only verified the happy path. The implementation has guards at lines 221-223 that skip execution when subscriptions are loading or empty, but these weren't tested.

Changes

  • Added test for empty subscriptions list guard
  • Added test for subscriptions loading state guard

Both tests verify the use case is never invoked when guard conditions are met:

test(
  'refreshOverdueNextPayments does nothing when subscriptions are empty',
  () async {
    subscriptionsController.add(const []);
    // ... setup streams
    await viewModel.refreshOverdueNextPayments();
    
    verifyNever(() => refreshOverdueNextPaymentsUseCase(any()));
  },
);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: gonfff <42554983+gonfff@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on recounting subscriptions in resume app Add edge case tests for refreshOverdueNextPayments guards Jan 13, 2026
Copilot AI requested a review from gonfff January 13, 2026 08:26
@gonfff gonfff marked this pull request as ready for review January 13, 2026 08:59
@gonfff gonfff merged commit af1b90c into recount-subscribes-on-resume Jan 13, 2026
1 check passed
@gonfff gonfff deleted the copilot/sub-pr-12 branch January 13, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants