fix: register a dusk navigate adapter so ext.dusk.navigate drives GoRouter#6
Open
anilcancakir wants to merge 1 commit into
Open
fix: register a dusk navigate adapter so ext.dusk.navigate drives GoRouter#6anilcancakir wants to merge 1 commit into
anilcancakir wants to merge 1 commit into
Conversation
…outer MagicDuskIntegration.install() registered enrichers but no navigate adapter, so dusk:navigate --route was a no-op on GoRouter apps (it fell back to an ignored SystemNavigator broadcast). Registers an adapter via DuskPlugin.registerNavigateAdapter that calls MagicRouter.instance.to(path), returning false on an uninitialised router (#8, #13).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR fixes ext.dusk.navigate --route for GoRouter-based Magic apps by registering a Dusk navigate adapter during MagicDuskIntegration.install(), so Dusk navigation drives MagicRouter instead of falling back to the (ignored) SystemNavigator broadcast.
Changes:
- Register a
DuskPluginnavigate adapter that callsMagicRouter.instance.to(path)and returnsfalsewhen the router is not yet initialized (catchesStateError). - Clear the navigate adapter in
MagicDuskIntegration.resetForTesting()for clean test isolation. - Add integration tests covering adapter registration, reset behavior, and successful/unsuccessful navigation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/dusk_integration_test.dart | Adds widget + unit tests to validate navigate adapter registration, behavior, and reset semantics. |
| lib/src/dusk_integration.dart | Registers/clears the Dusk navigate adapter as part of the Magic↔Dusk integration lifecycle. |
| CHANGELOG.md | Documents the new navigate adapter behavior in the Unreleased section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes REPORT friction items #8, #13.
MagicDuskIntegration.install()registered 14 enrichers but no navigate adapter, sodusk:navigate --routewas a no-op on GoRouter apps (it fell back to an ignored SystemNavigator broadcast). Registers an adapter viaDuskPlugin.registerNavigateAdapterthat callsMagicRouter.instance.to(path), returning false on an uninitialised router (StateError).TDD. analyze 0, format 0-diff,
flutter test86 pass. The frozen dusk typedef is registered through, not modified; uses.to(path), not.toNamed.