From 8fb226b2b261abc0822a83a26aae2b836cb3cfeb Mon Sep 17 00:00:00 2001 From: Bret Little Date: Fri, 28 Jan 2022 09:40:09 -0500 Subject: [PATCH] fix: PR feedback update test --- .../Router/tests/DefaultRoutes.test.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/hydrogen/src/foundation/Router/tests/DefaultRoutes.test.tsx b/packages/hydrogen/src/foundation/Router/tests/DefaultRoutes.test.tsx index d169959e36..92147a6811 100644 --- a/packages/hydrogen/src/foundation/Router/tests/DefaultRoutes.test.tsx +++ b/packages/hydrogen/src/foundation/Router/tests/DefaultRoutes.test.tsx @@ -44,13 +44,22 @@ it('handles index pages', () => { it('handles nested index pages', () => { const pages: ImportGlobEagerOutput = { + './pages/products/index.server.jsx': STUB_MODULE, + './pages/products/[handle].server.jsx': STUB_MODULE, './pages/blogs/index.server.jsx': STUB_MODULE, './pages/products/snowboards/fastones/index.server.jsx': STUB_MODULE, + './pages/articles/index.server.jsx': STUB_MODULE, + './pages/articles/[...handle].server.jsx': STUB_MODULE, }; const routes = createRoutesFromPages(pages); expect(routes).toEqual([ + { + path: '/products', + component: STUB_MODULE.default, + exact: true, + }, { path: '/blogs', component: STUB_MODULE.default, @@ -61,6 +70,21 @@ it('handles nested index pages', () => { component: STUB_MODULE.default, exact: true, }, + { + path: '/articles', + component: STUB_MODULE.default, + exact: true, + }, + { + path: '/products/:handle', + component: STUB_MODULE.default, + exact: true, + }, + { + path: '/articles/:handle', + component: STUB_MODULE.default, + exact: false, + }, ]); });