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

fix: hash loads json spec #160

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

blue86321
Copy link
Contributor

Summary

Fix json specs route issues when url contains # #158

Test Plan

Command

npm install
npx playwright install
npm run test:e2e

Result

> @fastify/swagger-ui@5.0.0-pre.fv5.1 test:e2e
> npx playwright test


Running 8 tests using 4 workers
  8 passed (12.2s

Result wihout new test

> @fastify/swagger-ui@5.0.0-pre.fv5.1 test:e2e
> npx playwright test


Running 8 tests using 4 workers
  1) [chromium] › custom.test.js:82:3 › Check redirection and url handling of static assets › Check root UI with hash loads json spec 

    Test timeout of 30000ms exceeded.

    Error: page.waitForResponse: Test timeout of 30000ms exceeded.
    =========================== logs ===========================
    waiting for response /json/
    ============================================================

      81 |
      82 |   test('Check root UI with hash loads json spec', async ({ page }) => {
    > 83 |     const jsonResponsePromise = page.waitForResponse(/json/)
         |                                      ^
      84 |     await page.goto(`${URL_DOCUMENTATION}#default/get_example`)
      85 |
      86 |     // Check if the page has requested the json spec, and if so has it succeeded

        at .../fastify-swagger-ui/e2e/custom.test.js:83:38

  1 failed
    [chromium] › custom.test.js:82:3 › Check redirection and url handling of static assets › Check root UI with hash loads json spec 
  7 passed (33.8s)

Checklist

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: Chun-Wei Chang <50546951+blue86321@users.noreply.github.com>
@mcollina mcollina merged commit 2c390ff into fastify:master Jul 8, 2024
18 of 21 checks passed
mcollina pushed a commit that referenced this pull request Jul 19, 2024
* fix: resolveUrl hash

* test: case for hash loads json spec

* fix: split 1

Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
Signed-off-by: Chun-Wei Chang <50546951+blue86321@users.noreply.github.com>

---------

Signed-off-by: Chun-Wei Chang <50546951+blue86321@users.noreply.github.com>
Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants