Skip to content

Hook routes: fail when the expected state isn't reached #103

Closed

Description

@tmashara

A before hook that clicks to open a menu has no way to say what it expected. If the click misses (the element isn't visible at that width, or the selector is stale), the shot quietly records the closed state, and both sides match.

To confirm the open dropdown (.select-items on www.metabase.com/partners) was actually captured, I wrote a separate Playwright script that read the open element's computed borders on both sides.

Suggestion: an expect field on route objects, e.g. { left: "/partners", before: openDropdown, expect: ".select-items:not(.select-hide)" }. The shot errors (or is marked "state not reached") if it doesn't match on either side.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions