Skip to content

Commit 259bdf0

Browse files
add e2e tests for vue and solid
remove hash workaround for dynamically imported chunks' CSS
1 parent 0c7281d commit 259bdf0

75 files changed

Lines changed: 2878 additions & 404 deletions

Some content is hidden

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

‎e2e/react-start/start-manifest/tests/start-manifest.spec.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { readdir } from 'node:fs/promises'
55
import path from 'node:path'
66
import { pathToFileURL } from 'node:url'
77

8-
test.skip(process.env.MODE === 'dev', 'Prod-only manifest dehydration coverage')
9-
108
const ROOT_SHELL_COLOR = 'rgb(22, 101, 52)'
119
const ROUTE_ONE_COLOR = 'rgb(30, 64, 175)'
1210
const ROUTE_TWO_COLOR = 'rgb(126, 34, 206)'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "tanstack-solid-start-e2e-start-manifest",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"build": "vite build && tsc --noEmit",
8+
"preview": "vite preview",
9+
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
10+
"test:e2e": "playwright test --project=chromium"
11+
},
12+
"dependencies": {
13+
"@tanstack/solid-router": "workspace:^",
14+
"@tanstack/solid-start": "workspace:^",
15+
"solid-js": "^1.9.10"
16+
},
17+
"devDependencies": {
18+
"@playwright/test": "^1.50.1",
19+
"@tanstack/router-e2e-utils": "workspace:^",
20+
"@types/node": "^22.10.2",
21+
"srvx": "^0.11.9",
22+
"typescript": "^6.0.2",
23+
"vite": "^8.0.0",
24+
"vite-plugin-solid": "^2.11.11"
25+
},
26+
"nx": {
27+
"targets": {
28+
"test:e2e": {
29+
"parallelism": false
30+
}
31+
}
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
import { getTestServerPort } from '@tanstack/router-e2e-utils'
3+
import packageJson from './package.json' with { type: 'json' }
4+
5+
const PORT = await getTestServerPort(packageJson.name)
6+
const baseURL = `http://localhost:${PORT}`
7+
8+
export default defineConfig({
9+
testDir: './tests',
10+
workers: 1,
11+
reporter: [['line']],
12+
13+
use: {
14+
baseURL,
15+
},
16+
17+
webServer: {
18+
command: `pnpm build && PORT=${PORT} pnpm start`,
19+
url: baseURL,
20+
reuseExistingServer: !process.env.CI,
21+
stdout: 'pipe',
22+
},
23+
24+
projects: [
25+
{
26+
name: 'chromium',
27+
use: { ...devices['Desktop Chrome'] },
28+
},
29+
],
30+
})
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/// <reference types="vite/client" />
2+
import { ClientOnly, Link, Outlet, linkOptions } from '@tanstack/solid-router'
3+
import styles from '~/styles/root-shell.module.css'
4+
5+
const ROUTES = linkOptions([
6+
{ to: '/', label: 'home' },
7+
{ to: '/a', label: '/a' },
8+
{ to: '/b', label: '/b' },
9+
{ to: '/lazy-css-static', label: '/lazy-css-static' },
10+
{ to: '/lazy-css-lazy', label: '/lazy-css-lazy' },
11+
{ to: '/r1', label: '/r1' },
12+
{ to: '/r2', label: '/r2' },
13+
{ to: '/shared-a', label: '/shared-a' },
14+
])
15+
16+
export function AppShell() {
17+
return (
18+
<div class={styles.shell}>
19+
<nav class={styles.nav}>
20+
{ROUTES.map((route) => (
21+
<Link {...route} data-testid={`nav-${route.label}`}>
22+
{route.label}
23+
</Link>
24+
))}
25+
</nav>
26+
27+
<main class={styles.content}>
28+
<div class={styles.rootBadge} data-testid="root-shell-marker">
29+
Start manifest CSS root shell
30+
</div>
31+
<ClientOnly>
32+
<div data-testid="hydration-marker">hydrated</div>
33+
</ClientOnly>
34+
<Outlet />
35+
</main>
36+
</div>
37+
)
38+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference types="vite/client" />
2+
import styles from '~/styles/shared-card.module.css'
3+
4+
export function SharedCard({ label }: { label: string }) {
5+
return (
6+
<div class={styles.card} data-testid="shared-card">
7+
Shared card {label}
8+
</div>
9+
)
10+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/// <reference types="vite/client" />
2+
import { Link, linkOptions } from '@tanstack/solid-router'
3+
import styles from '~/styles/shared-layout.module.css'
4+
5+
const ROUTES = linkOptions([
6+
{ to: '/shared-a', label: '/shared-a' },
7+
{ to: '/shared-b', label: '/shared-b' },
8+
{ to: '/shared-c', label: '/shared-c' },
9+
])
10+
11+
export function SharedNestedLayout(props: { children?: any }) {
12+
return (
13+
<section class={styles.layout} data-testid="shared-layout-shell">
14+
<div class={styles.heading} data-testid="shared-layout-heading">
15+
Shared nested layout CSS
16+
</div>
17+
18+
<nav class={styles.nav}>
19+
{ROUTES.map((route) => (
20+
<Link {...route} data-testid={`nav-${route.label}`}>
21+
{route.label}
22+
</Link>
23+
))}
24+
</nav>
25+
26+
<div class={styles.body} data-testid="shared-layout-copy">
27+
{props.children}
28+
</div>
29+
</section>
30+
)
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/// <reference types="vite/client" />
2+
import styles from '~/styles/shared-widget.module.css'
3+
4+
export function SharedWidget() {
5+
return (
6+
<div class={styles.widget} data-testid="shared-widget">
7+
<div class={styles.title} data-testid="shared-widget-title">
8+
Shared widget styles
9+
</div>
10+
<div class={styles.content} data-testid="shared-widget-content">
11+
This widget uses CSS shared by a static route and a lazy route.
12+
</div>
13+
</div>
14+
)
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { SharedWidget } from './SharedWidget'
2+
3+
export default function SharedWidgetLazy() {
4+
return <SharedWidget />
5+
}

0 commit comments

Comments
 (0)