Skip to content

Commit 2c872eb

Browse files
committed
metadata continuation
1 parent 1fc5a46 commit 2c872eb

File tree

167 files changed

+14513
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+14513
-730
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ data.db
1313
# file as well, but since this is for a workshop
1414
# we're going to keep them around.
1515
# .env
16+
test-results

exercises/01.routing/01.problem.routing/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and implement the following routes:
1818
- `Landing page layout` that wraps all the other routes (`./routes/_landing.tsx`).
1919
- `/` - The index route that renders the landing page (`./routes/_landing._index/route.tsx`).
2020
- `/about` - The about route that renders the `About` page (`./routes/_landing.about.tsx`).
21-
- `/products` - The products route that renders the `Products` page (`./routes/_landing.products.tsx`).
21+
- `/products` - The products route that renders the `Products` page (`./routes/_landing.products._index.tsx`).
2222
- `/products/:productId` - The product details route that renders the `ProductDetails` page (`./routes/_landing.products.$productId.tsx`).
2323
- `/contact` - The contact route that renders the `Contact` page (`./routes/_landing.contact.tsx`).
2424
- `/cart` - The cart route that renders the `Cart` page (`./routes/_landing.cart.tsx`).

exercises/01.routing/01.problem.routing/app/routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
// - Home page ("/")
1414
// - About page ("/about")
1515
// - Contact page ("/contact")
16+
// 💰 Create a products route with children here!
1617
// - Products page ("/products")
1718
// - Product details page ("/products/:productId")
1819
// - Terms of Use page ("/terms-of-use")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function ProductsPage() {
2+
return (
3+
<div className="min-h-screen bg-stone-50 dark:bg-gray-900">
4+
Products page!
5+
</div>
6+
)
7+
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
export default function ProductsPage() {
2-
return (
3-
<div className="min-h-screen bg-stone-50 dark:bg-gray-900">
4-
Products page!
5-
</div>
6-
)
7-
}
1+
import { Outlet } from "react-router"
2+
3+
export default function ProductsLandingPage() {
4+
return (
5+
<>
6+
<Outlet />
7+
</>
8+
)
9+
}

exercises/01.routing/01.problem.routing/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
forbidOnly: !!process.env.CI,
1414
retries: process.env.CI ? 2 : 0,
1515
workers: process.env.CI ? 1 : undefined,
16-
reporter: 'html',
16+
reporter: [['html', { open: 'never' }]],
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',

exercises/01.routing/01.problem.routing/tests/e2e/routing.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ test.describe('Routing E2E Tests', () => {
55
page,
66
}) => {
77
await page.goto('/')
8-
await expect(page.getByRole('heading', { name: 'Step Into' })).toBeVisible()
8+
await expect(page.getByText("Landing page!")).toBeVisible()
99
})
1010

1111
test('should navigate to about page and render correct content', async ({
1212
page,
1313
}) => {
1414
await page.goto('/about')
15-
await expect(page.getByRole('heading', { name: 'Our Story' })).toBeVisible()
15+
await expect(page.getByText("About page!")).toBeVisible()
1616
})
1717

1818
test('should navigate to contact page and render correct content', async ({
1919
page,
2020
}) => {
2121
await page.goto('/contact')
2222
await expect(
23-
page.getByRole('heading', { name: 'Get in Touch' }),
23+
page.getByText("Contact page!"),
2424
).toBeVisible()
2525
})
2626

@@ -29,7 +29,7 @@ test.describe('Routing E2E Tests', () => {
2929
}) => {
3030
await page.goto('/products')
3131
await expect(
32-
page.getByRole('heading', { name: 'All Products' }),
32+
page.getByText("Products page!"),
3333
).toBeVisible()
3434
})
3535

@@ -38,7 +38,7 @@ test.describe('Routing E2E Tests', () => {
3838
}) => {
3939
await page.goto('/terms-of-service')
4040
await expect(
41-
page.getByRole('heading', { name: 'Terms of Service' }),
41+
page.getByText("Terms of Service page!"),
4242
).toBeVisible()
4343
})
4444

@@ -47,7 +47,7 @@ test.describe('Routing E2E Tests', () => {
4747
}) => {
4848
await page.goto('/terms-of-use')
4949
await expect(
50-
page.getByRole('heading', { name: 'Terms of Use' }),
50+
page.getByText("Terms of Use page!"),
5151
).toBeVisible()
5252
})
5353

@@ -56,7 +56,7 @@ test.describe('Routing E2E Tests', () => {
5656
}) => {
5757
await page.goto('/products/1')
5858
await expect(
59-
page.getByRole('heading', { name: 'Air Max Revolution' }),
59+
page.getByText("Product Detail Page"),
6060
).toBeVisible()
6161
})
6262
})

exercises/01.routing/01.solution.routing/app/routes.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default [
1010
index('./routes/_landing._index/route.tsx'),
1111
route('terms-of-use', './routes/_landing.terms-of-use.tsx'),
1212
route('terms-of-service', './routes/_landing.terms-of-service.tsx'),
13-
route('products', './routes/_landing.products.tsx'),
14-
route('products/:productId', './routes/_landing.products.$productId.tsx'),
13+
route('products', './routes/_landing.products.tsx', [
14+
index('./routes/_landing.products._index.tsx'),
15+
route(':productId', './routes/_landing.products.$productId.tsx'),
16+
]),
1517
route('contact', './routes/_landing.contact.tsx'),
1618
route('about', './routes/_landing.about.tsx'),
1719
route('cart', './routes/_landing.cart.tsx'),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function ProductsPage() {
2+
return (
3+
<div className="min-h-screen bg-stone-50 dark:bg-gray-900">
4+
Products page!
5+
</div>
6+
)
7+
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
export default function ProductsPage() {
2-
return (
3-
<div className="min-h-screen bg-stone-50 dark:bg-gray-900">
4-
Products page!
5-
</div>
6-
)
7-
}
1+
import { Outlet } from "react-router"
2+
3+
export default function ProductsLandingPage() {
4+
return (
5+
<>
6+
<Outlet />
7+
</>
8+
)
9+
}

0 commit comments

Comments
 (0)