Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Promise<void> from FrameElement.reload #661

Merged
merged 2 commits into from Aug 1, 2022

Commits on Aug 1, 2022

  1. Return Promise<void> from FrameElement.reload

    Following the pattern established by `Turbo.visit(...)` and
    `Turbo.visit(..., { frame: "..." })`, return the `FrameElement.loaded`
    promise from calls to `FrameElement.reload()`.
    
    That way, callers can block on it:
    
    ```js
    const frame = document.getElementById("my-frame")
    await frame.reload()
    // ...
    ```
    seanpdoyle committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    f64957b View commit details
    Browse the repository at this point in the history
  2. Resolve flaky navigation tests

    Switch the tests from a time-based waiting mechanism (1200 milliseconds)
    to an event-based waiting mechanism (waiting for `turbo:load`).
    
    ```
    2) [firefox] › navigation_tests.ts:341:1 › test double-clicking on a link ========================
    
      AssertionError: expected '/src/tests/fixtures/navigation.html' to equal '/__turbo/delayed_response'
    
        344 |
        345 |   await nextBody(page, 1200)
      > 346 |   assert.equal(pathname(page.url()), "/__turbo/delayed_response")
            |          ^
        347 |   assert.equal(await visitAction(page), "advance")
        348 | })
        349 |
    
          at /home/runner/work/turbo/turbo/src/tests/functional/navigation_tests.ts:346:10
    
     1) [firefox] › navigation_tests.ts:131:1 › test following a same-origin POST form button[data-turbo-action=replace]
    
        page.click: Target closed
        =========================== logs ===========================
        waiting for selector "#same-origin-replace-form-submitter-post button"
          selector resolved to visible <button data-turbo-action="replace">Same-origin form[method="post"] button[data-turbo…</button>
        attempting click action
          waiting for element to be visible, enabled and stable
          element is visible, enabled and stable
          scrolling into view if needed
        ============================================================
    
          130 |
          131 | test("test following a same-origin POST form button[data-turbo-action=replace]", async ({ page }) => {
        > 132 |   page.click("#same-origin-replace-form-submitter-post button")
              |        ^
          133 |   await nextBody(page)
          134 |
          135 |   assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html")
    
            at
    /home/runner/work/turbo/turbo/src/tests/functional/navigation_tests.ts:132:8
    ```
    seanpdoyle committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    962d27c View commit details
    Browse the repository at this point in the history