Skip to content

FOLLOW-UP: Replace WaitFor(true, ...) with condition-based wait in preserve-inputs test (from PR #59) #68

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #59.

Source PR: #59
PR Title: feat: add patterns example app — Session 1 (scaffold + forms #1-7)
Suggested by: @Copilot
Comment type: review comment on patterns/patterns_test.go

Task Description

The preserve-inputs test uses e2etest.WaitFor("true", ...) after form submission, which doesn't wait on any specific post-submit condition and can be flaky. The repo's E2E checklist (CLAUDE.md:78-80) recommends condition-based waits.

Proposed fix: Wait for a concrete DOM change (e.g., a success indicator, or the expected input value being present) before reading/asserting field values.

Original Comment

This uses e2etest.WaitFor(true, ...) after form submission, which doesn't wait on any specific post-submit condition and can be flaky. The repo's E2E checklist recommends condition-based waits (CLAUDE.md:78-80). Prefer waiting for a concrete DOM change (e.g., a success indicator, or the expected input value being present) before reading/asserting field values.

e2etest.WaitFor(`document.querySelector('input[name="name"]') !== null && document.querySelector('input[name="name"]').value === "Test Name"`, 3*time.Second),

This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions