Skip to content

Commit 7114ecd

Browse files
test: e2e suite (8 apps + server↔client probe) + unit/component coverage (#472)
* test(e2e): scaffold Playwright harness, helper package, react-vite app, shell test-ids * test(e2e): full react-vite shell behavior suite + event-probe * ci(e2e): build packages before running the Playwright suite on every PR * test(e2e): react-start runtime app + server probe * test(e2e): extend event-probe with server-ping emitter + receiver * test(e2e): promote react-start to real server->client via #384 runtime bridge; lock e2e deps * test(e2e): react-nitro runtime app + server probe * test(e2e): cloudflare/workerd runtime app * test(e2e): solid adapter smoke * test(e2e): vue adapter smoke * test(e2e): preact adapter smoke * test(e2e): angular adapter smoke * ci(e2e): run all runtime + adapter e2e apps on every PR; lock e2e deps * test(unit): fill pure-function coverage gaps in devtools + devtools-vite * test(component): Solid shell render + reactivity tests * test(component): React adapter portal wiring test * chore(e2e): formatting and lint fixes * fix(devtools-ui): Checkbox reflects controlled `checked` prop updates * chore(knip): declare doc-script entrypoints and ignore generated intent bin stubs * ci: apply automated fixes * ci(e2e): pin actions to commit SHAs (org policy + zizmor) * test(e2e): make server->client probe deterministic (re-emit until delivered) * ci(e2e): run e2e projects serially — parallel dev servers collide on the shared devtools bus port --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent b1c1b20 commit 7114ecd

122 files changed

Lines changed: 3674 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools-ui': patch
3+
---
4+
5+
Fix `Checkbox` ignoring controlled `checked` prop updates. It previously read `checked` into internal state only once at mount, so it never reflected later prop changes when used as a controlled input (e.g. the devtools settings panel). It now reflects the `checked` prop whenever it is provided and falls back to internal state only when uncontrolled.

‎.github/workflows/pr.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ jobs:
3434
main-branch-name: main
3535
- name: Run Checks
3636
run: pnpm run test:pr
37+
e2e:
38+
name: E2e
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45+
with:
46+
fetch-depth: 0
47+
persist-credentials: false
48+
- name: Setup Tools
49+
uses: TanStack/config/.github/setup@190f659075ff0845850e330883eb26d7ffd0671f # main
50+
- name: Build packages
51+
run: pnpm run build:all
52+
- name: Install Playwright Chromium
53+
run: pnpm --filter @tanstack/devtools-e2e-react-vite exec playwright install --with-deps chromium
54+
- name: Run e2e
55+
run: pnpm run test:e2e
3756
preview:
3857
name: Preview
3958
runs-on: ubuntu-latest

‎e2e/apps/angular/.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
.angular
4+
test-results
5+
playwright-report
6+
playwright/.cache

‎e2e/apps/angular/angular.json‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"cli": {
5+
"packageManager": "pnpm",
6+
"analytics": false,
7+
"cache": {
8+
"enabled": false
9+
}
10+
},
11+
"newProjectRoot": "projects",
12+
"projects": {
13+
"devtools-e2e-angular": {
14+
"projectType": "application",
15+
"schematics": {},
16+
"root": "",
17+
"sourceRoot": "src",
18+
"prefix": "app",
19+
"architect": {
20+
"build": {
21+
"builder": "@angular/build:application",
22+
"options": {
23+
"browser": "src/main.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"assets": [
26+
{
27+
"glob": "**/*",
28+
"input": "public"
29+
}
30+
],
31+
"styles": ["src/styles.css"]
32+
},
33+
"configurations": {
34+
"production": {
35+
"budgets": [
36+
{
37+
"type": "initial",
38+
"maximumWarning": "500kB",
39+
"maximumError": "1MB"
40+
},
41+
{
42+
"type": "anyComponentStyle",
43+
"maximumWarning": "4kB",
44+
"maximumError": "8kB"
45+
}
46+
],
47+
"outputHashing": "all"
48+
},
49+
"development": {
50+
"optimization": false,
51+
"extractLicenses": false,
52+
"sourceMap": true
53+
}
54+
},
55+
"defaultConfiguration": "production"
56+
},
57+
"serve": {
58+
"builder": "@angular/build:dev-server",
59+
"configurations": {
60+
"production": {
61+
"buildTarget": "devtools-e2e-angular:build:production"
62+
},
63+
"development": {
64+
"buildTarget": "devtools-e2e-angular:build:development"
65+
}
66+
},
67+
"defaultConfiguration": "development"
68+
},
69+
"test": {
70+
"builder": "@angular/build:unit-test"
71+
}
72+
}
73+
}
74+
}
75+
}

‎e2e/apps/angular/package.json‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@tanstack/devtools-e2e-angular",
3+
"nx": {
4+
"name": "devtools-e2e-angular"
5+
},
6+
"private": true,
7+
"scripts": {
8+
"dev": "ng serve --port 4180",
9+
"test:e2e": "playwright test"
10+
},
11+
"dependencies": {
12+
"@angular/common": "^21.2.0",
13+
"@angular/compiler": "^21.2.0",
14+
"@angular/core": "^21.2.0",
15+
"@angular/forms": "^21.2.0",
16+
"@angular/platform-browser": "^21.2.0",
17+
"@angular/router": "^21.2.0",
18+
"@tanstack/angular-devtools": "workspace:*",
19+
"rxjs": "~7.8.0",
20+
"tslib": "^2.3.0"
21+
},
22+
"devDependencies": {
23+
"@angular/build": "^21.2.0",
24+
"@angular/cli": "^21.2.0",
25+
"@angular/compiler-cli": "^21.2.0",
26+
"@playwright/test": "^1.49.0",
27+
"@tanstack/devtools-e2e": "workspace:*",
28+
"typescript": "~5.9.2"
29+
}
30+
}
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+
3+
export default defineConfig({
4+
testDir: './tests',
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 1 : 0,
8+
reporter: process.env.CI ? 'github' : 'list',
9+
use: {
10+
baseURL: 'http://localhost:4180',
11+
trace: 'on-first-retry',
12+
},
13+
projects: [
14+
{
15+
name: 'chromium',
16+
use: {
17+
...devices['Desktop Chrome'],
18+
launchOptions: {
19+
args: ['--enable-features=DocumentPictureInPictureAPI'],
20+
},
21+
},
22+
},
23+
],
24+
webServer: {
25+
command: 'pnpm run dev',
26+
url: 'http://localhost:4180',
27+
timeout: 180_000,
28+
reuseExistingServer: !process.env.CI,
29+
},
30+
})
14.7 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {
2+
ApplicationConfig,
3+
provideBrowserGlobalErrorListeners,
4+
} from '@angular/core'
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideBrowserGlobalErrorListeners()],
8+
}

‎e2e/apps/angular/src/app/app.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ChangeDetectionStrategy, Component, signal } from '@angular/core'
2+
import { TanStackDevtools } from '@tanstack/angular-devtools'
3+
import type { TanStackDevtoolsAngularPlugin } from '@tanstack/angular-devtools'
4+
5+
@Component({
6+
selector: 'app-root',
7+
imports: [TanStackDevtools],
8+
template: `
9+
<h1>angular e2e</h1>
10+
11+
@defer (when true) {
12+
<tanstack-devtools [plugins]="plugins()" />
13+
}
14+
`,
15+
changeDetection: ChangeDetectionStrategy.OnPush,
16+
})
17+
export class App {
18+
readonly plugins = signal<TanStackDevtoolsAngularPlugin[]>([
19+
{
20+
name: 'Demo',
21+
render: () => import('./devtools/demo-panel'),
22+
},
23+
])
24+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ChangeDetectionStrategy, Component, input } from '@angular/core'
2+
3+
@Component({
4+
selector: `demo-panel`,
5+
template: ` <div data-testid="demo-plugin">demo plugin content</div> `,
6+
changeDetection: ChangeDetectionStrategy.OnPush,
7+
})
8+
export default class DemoPanel {
9+
// Automatically added by the devtools host
10+
readonly theme = input<string>()
11+
}

0 commit comments

Comments
 (0)