Skip to content

test(amplify_push): add Dart and Android unit tests#7066

Closed
ekjotmultani wants to merge 0 commit into
feat/amplify-push-v3from
feat/amplify-push-v3-tests
Closed

test(amplify_push): add Dart and Android unit tests#7066
ekjotmultani wants to merge 0 commit into
feat/amplify-push-v3from
feat/amplify-push-v3-tests

Conversation

@ekjotmultani

Copy link
Copy Markdown
Member

Summary

Adds the Dart and Android (Kotlin) unit tests for the amplify_push package, split into their own PR so the package implementation, the tests, and the example app each review independently.

Stacked on #6985. This targets the feat/amplify-push-v3 branch (the package PR), so the diff shows only the test files. Once #6985 merges, this will be rebased onto main.

What's here

  • Dart unit tests (test/): client lifecycle, flutter API dispatch, permissions, badge, and exception mapping
  • Android unit tests (android/src/test/): plugin, background service, events stream handler, notification utils, and Firebase messaging service

Verification

  • Dart: 31 tests pass (flutter test). These run automatically in this PR's CI (flutter_vm).
  • Android: 33 tests pass (./gradlew :amplify_push:testDebugUnitTest), verified locally.

CI note for the Android tests

In this repo, Android unit tests are example-hosted: aft only generates the amplify_push_android.yaml workflow when both android/src/test/ and example/android/ are present in the package (see generate_workflows_command.dart). Because the tests and the example app are on separate branches, that workflow materializes on main once the package, tests, and example PRs all merge — at which point the 33 Android tests run in CI. Until then they're verified locally (above). If we'd prefer them running in CI pre-merge, the tests branch can be stacked on the example branch instead.

Follow-up: iOS unit tests

The package has no iOS native unit tests yet (only the Flutter template RunnerTests.swift stub). The original push plugin similarly relied on integration/example testing for iOS rather than native XCTest units. Adding native iOS unit tests is tracked as a follow-up.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.98%. Comparing base (9e9a51c) to head (8604cbe).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feat/amplify-push-v3    #7066      +/-   ##
========================================================
- Coverage                 43.23%   42.98%   -0.25%     
========================================================
  Files                        99      105       +6     
  Lines                      7769     8186     +417     
  Branches                   3401     3586     +185     
========================================================
+ Hits                       3359     3519     +160     
- Misses                     4410     4667     +257     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ekjotmultani ekjotmultani force-pushed the feat/amplify-push-v3 branch from 9e9a51c to 5dbc37a Compare June 30, 2026 16:54
@ekjotmultani ekjotmultani force-pushed the feat/amplify-push-v3-tests branch from 8604cbe to 5dbc37a Compare June 30, 2026 16:56
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