Skip to content

test(menu): drive dev:mode through the prompt - #37

Merged
tyrsson merged 1 commit into
1.0.xfrom
test/menu-drives-dev-mode
Sep 26, 2026
Merged

tyrsson merged 1 commit into
1.0.xfrom
test/menu-drives-dev-mode

Conversation

@tyrsson

@tyrsson tyrsson commented Sep 26, 2026

Copy link
Copy Markdown
Member

What

A test for the path a user actually takes: the menu selecting dev:mode, toggling --disable with
Space, submitting, and the command running for real.

That combination had no coverage. dev:mode was tested directly and the menu machinery was tested
against fixtures, but nothing exercised the two together — so the prompt being built from a real
command's definition, and the flags it produces reaching the command, was only ever verified by hand.
The prompt is generated from the command's own InputDefinition, so a wrapped command belongs in the
menu's tests as well as in its own.

It asserts the real side effects, not just rendered text: the active file and the config cache are
both gone afterwards, and the result frame reports success.

Gates

Gate Result
mago fmt --check / lint / analyze / guard clean
PHPUnit 142 unit, 2 integration
Line coverage 100% (530/530 statements, 63/63 methods)
Infection MSI 100%, 0 escaped (382 mutants)

Refs #35

dev:mode was tested directly and the menu machinery was tested, but the
two were never exercised together, so the path a user actually takes was
only ever verified by hand. The prompt is built from the command's own
definition, so a wrapped command belongs in the menu's tests too.

The test selects dev:mode, toggles --disable with Space, submits, and
asserts the real side effects: the active file and the config cache are
both gone, and the result frame reports success.

Signed-off-by: Joey Smith <jsmith@webinertia.net>
@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tyrsson
tyrsson merged commit 52babbd into 1.0.x Sep 26, 2026
12 checks passed
@tyrsson
tyrsson deleted the test/menu-drives-dev-mode branch September 26, 2026 07:19
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