Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Nov 3, 2022
1 parent ecdc739 commit 101f16e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/e2e/app-dir/app-static.test.ts
Expand Up @@ -54,6 +54,8 @@ describe('app-dir static/dynamic handling', () => {
'dynamic-no-gen-params-ssr/[slug]/page.js',
'dynamic-no-gen-params/[slug]/page.js',
'hooks/use-pathname/[slug]/page.js',
'hooks/use-pathname/slug.html',
'hooks/use-pathname/slug.rsc',
'hooks/use-search-params/[slug]/page.js',
'ssr-auto/cache-no-store/page.js',
'ssr-auto/fetch-revalidate-zero/page.js',
Expand Down Expand Up @@ -114,6 +116,11 @@ describe('app-dir static/dynamic handling', () => {
srcRoute: '/blog/[author]/[slug]',
dataRoute: '/blog/styfle/second-post.rsc',
},
'/hooks/use-pathname/slug': {
dataRoute: '/hooks/use-pathname/slug.rsc',
initialRevalidateSeconds: false,
srcRoute: '/hooks/use-pathname/[slug]',
},
})
expect(manifest.dynamicRoutes).toEqual({
'/blog/[author]/[slug]': {
Expand All @@ -128,6 +135,12 @@ describe('app-dir static/dynamic handling', () => {
fallback: false,
routeRegex: normalizeRegEx('^\\/blog\\/([^\\/]+?)(?:\\/)?$'),
},
'/hooks/use-pathname/[slug]': {
dataRoute: '/hooks/use-pathname/[slug].rsc',
dataRouteRegex: '^\\/hooks\\/use\\-pathname\\/([^\\/]+?)\\.rsc$',
fallback: null,
routeRegex: '^\\/hooks\\/use\\-pathname\\/([^\\/]+?)(?:\\/)?$',
},
})
})
}
Expand Down Expand Up @@ -405,7 +418,8 @@ describe('app-dir static/dynamic handling', () => {
}
})

describe('usePathname', () => {
// TODO: needs updating as usePathname should not bail
describe.skip('usePathname', () => {
if (isDev) {
it('should bail out to client rendering during SSG', async () => {
const res = await fetchViaHTTP(next.url, '/hooks/use-pathname/slug')
Expand Down

0 comments on commit 101f16e

Please sign in to comment.