Files
firezone/apps
Jamil ddc8b32970 Add tests to ensure path changes when modal is dismissed (#1356)
Refs #1353 

I was looking for a `refute_el` helper to check for `.modal.is-active`
*not* being on the page, but that would take time to write 😅

This checks to ensure the URL is updated, which should cause the
`@live_action` to change, the view to be patched, and the modal to be
dismissed, but isn't the most straightforward way to make sure the modal
isn't visible.

We've hit this problem twice before (am not successful this morning
finding the relevant issues):

* If the WebSocket is flapping, the event may not register. But usually
the browser will refresh if this is the case (we have a red indicator in
the upper-right to indicate if the websocket is not connected, i.e. the
views aren't "live")
* A CSS bug caused the click event to target the wrong LiveView PID (the
modal's parent I believe), which ended up crashing it because it didn't
have the "close" event handler defined. I believe the escape keydown
still closed the view though in that case.

This feels more like the first issue, given the acceptance test is
passing.

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-01-23 09:31:37 -06:00
..