Closed joshk closed 4 weeks ago
@joshk thanks for opening the issue. I'm looking at the code you shared, and I can't really see how things would've changed in 0.3.2. I'll try to take a deeper look at the changes we made to see if anything comes up.
In the meantime, is there a way you could try to reproduce the error in a simpler phoenix app? something I can pull down and play around with?
Another question: do you know if you also updated LiveView when you upgraded phoenix test 0.3.2? The error you're seeing looks like something that would come out of LiveView or LiveViewTest, which makes me think something else might've changed.
@joshk I'm going to close this for now since it seems like there's no way for me to reproduce this.
If you find the time to create a simple Phoenix app that reproduces the error, I'd be happy to reopen this!
Totally understand. We are stuck on 0.3.1 for now, until I can show the issue in a small app.
Another question: do you know if you also updated LiveView when you upgraded phoenix test 0.3.2? The error you're seeing looks like something that would come out of LiveView or LiveViewTest, which makes me think something else might've changed.
I forgot to reply and say that no, we haven't changed LiveView versions, this is isolated to only PhoenixTest.
I'll reopen this in case you get time to create a simple app to try to reproduce what's going on there.
@joshk while solving another issue, I figured out why your test started breaking after 0.3.2
In 0.3.2, we introduced the ability for checkboxes to handle phx-click
attributes. The intention was for them to be handled outside of forms, but technically, we just handle the phx-click
first.
LiveViewTest (what PhoenixTest is using underneath) doesn't support testing phx-click
s that only have JS.dispatch/1
in them. So, the combination of PhoenixTest now attempting to handle your phx-click
and of LiveViewTest not handling JS.dispatch/1
leads to your test now giving you that "no push or navigation command found within JS commands"
I think PhoenixTest should probably ignore any JS commands that don't have a push or navigate in them. I'll see how to work on this.
@joshk this should now be fixed in main
. Got the fix in #139. Please let me know if you upgrade (once I release a new version), and if you continue to see errors.
@germsvel my lord you are a legend! I'll this a test run this weekend!
After upgrade
phoenix_test
to 0.3.2 I have two tests failing for the same reason.This is the full test here: https://github.com/nerves-hub/nerves_hub_web/blob/main/test/nerves_hub_web/live/org/certificate_authorities_test.exs#L119-L166
And here is the full html: https://github.com/nerves-hub/nerves_hub_web/blob/main/lib/nerves_hub_web/live/org/certificate_authority_templates/new_ca_template.html.heex (the checkbox in question: https://github.com/nerves-hub/nerves_hub_web/blob/main/lib/nerves_hub_web/live/org/certificate_authority_templates/new_ca_template.html.heex#L73)
Am I doing something wrong?