-
Notifications
You must be signed in to change notification settings - Fork 13
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: no-sw error shows for subdomain requests #491
fix: no-sw error shows for subdomain requests #491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review. FYI i'm attempting to update these changes so we don't need an entirely different project.. we should be able to set launchOptions
and other things in the testNoServiceWorker
test fixture but I was running into issues and wanted to get something working first.
name: 'no-service-worker', | ||
testMatch: /test-e2e\/no-service-worker\.test\.ts/, | ||
use: { | ||
...devices['Desktop Firefox'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this doesn't test no service worker functionality in chrome, but we shouldn't need to...?
{ default: true, component: ErrorPage ?? LazyHelperUi }, | ||
{ shouldRender: async () => renderChecks.shouldRenderNoServiceWorkerError(), component: LazyServiceWorkerErrorPage }, | ||
{ shouldRender: async () => renderChecks.shouldRenderRedirectsInterstitial(), component: LazyInterstitial }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the actual bug fix..
}) | ||
|
||
/** | ||
* You should use this fixture instead of the `test` fixture from `@playwright/test` when testing path routing via the service worker. | ||
*/ | ||
export const testPathRouting = base.extend<{ rootDomain: string, baseURL: string, protocol: string }>({ | ||
export const testPathRouting = test.extend<{ rootDomain: string, baseURL: string, protocol: string }>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk why this wasn't being done before, but all of our custom test fixtures now extend from our test
fixture above, so we get the isNoServiceWorkerProject
check for free without modifying all the others.
* | ||
* @see https://github.com/ipfs/service-worker-gateway/issues/272 | ||
*/ | ||
export const testNoServiceWorker = base.extend<{ rootDomain: string, baseURL: string, protocol: string }>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not extending our test
fixture above because that is trying to skip everything that skips tests on the isNoServiceWorkerProject(test)
check. we need the opposite here.
FYI: I can't seem to get the launch options and |
navigator.serviceWorker
is undefined #272Title
fix: no-sw error shows for subdomain requests
Description
Fixes #272 again
Adds tests to prevent regression
Notes & open questions
Change checklist