Skip to content

Firing a submit event in a form with submit type button but no event handlers #1693

Answered by linkdotnet
agiletea asked this question in Q&A
Discussion options

You must be logged in to vote

Hey hey @agiletea

I'm hoping I'm missing the obvious

No, but something may not be so obvious. bUnit, unlike Playwright and similar e2e test tools, isn't a browser running your code. We emulate a lot of things, but not everything. One of the things we don't emulate is form-post navigation. And the reason is that this is neither a Blazor nor (more importantly) your domain-concern.

To have a better example. if you set an style on an element display: none then the object is still there, but as bUnit doesn't render anything, nothing really changes (except the attribute).

From your code's point of view, it is the browser's concern that the navigation will happen. So, you would basically test …

Replies: 1 comment 1 reply

Comment options

linkdotnet
Mar 27, 2025
Maintainer Sponsor

You must be logged in to vote
1 reply
@agiletea
Comment options

Answer selected by agiletea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants