Skip to content

test(reminder): fix firebase errors - #68

Draft
jumpy-cat wants to merge 1 commit into
test-fixfrom
reminder-test-fix
Draft

test(reminder): fix firebase errors#68
jumpy-cat wants to merge 1 commit into
test-fixfrom
reminder-test-fix

Conversation

@jumpy-cat

@jumpy-cat jumpy-cat commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

The existing reminders code couldn't be tested without the side effect of firebase interactions. Refactored it to make testing the logic without triggering side-effects possible, then modified the tests accordingly. This should stop the error during test style messages from occuring when you run the tests.

Type of Change

  • Refactor / code improvement

Related Issues

none

Changes Made

  • Backend (TypeScript):
    • firebase is only initialized if initializeReminders is called
      • added call to jobs.ts
    • the main reminders class has a new field pure that dictates if it will do any firebase things, set via the mock argument in the constructor
      • { mock: false } in actual services
      • { mock: true } in test code
    • refactored existing update cancelling stuff a bit to make the code clearer
  • Firebase / Shared:
    • none

Testing Done

Flutter:

  • Do reminders still send?
    • Android Emulator
    • Physical device

Screenshots / Demo (if UI or notification change)

n/a

Checklist

  • Commit messages follow Conventional Commits
  • PR title follows [type](scope): short description
  • PR target branch is not main and is our current working update branch (e.g. maizebus2.1)
  • No print() / debugPrint() / console.log() left in production code
  • Secrets / keys not committed

Stack created with GitHub Stacks CLIGive Feedback 💬

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.

1 participant