@owlmeans/test-ui 0.1.18-rc.6 → 0.1.18-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/test-ui",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.18-rc.7",
|
|
5
|
+
"generatedAt": "2026-08-24T21:14:00.093Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -109,7 +109,7 @@ The per-package `tests/harness/mount.tsx` reads `?component=<name>` and `?props=
|
|
|
109
109
|
|
|
110
110
|
## Smoke-only baseline
|
|
111
111
|
|
|
112
|
-
For a package that only needs to prove the bun-test + chromium pipeline works
|
|
112
|
+
For a package that only needs to prove the bun-test + chromium pipeline works, skip the Vite harness and serve a `data:text/html` URL inline. Use this for a first spec in a package that has no harness yet — `web-panel` keeps one alongside a full Vite + chromium harness (`tests/harness/` plus a `tests/context.ts` wiring the Tailwind plugin, the `@` alias and a react dedupe), and that harness is the reference to copy for any package rendering real components:
|
|
113
113
|
|
|
114
114
|
```ts
|
|
115
115
|
import { afterAll, describe, expect, test } from 'bun:test'
|
|
@@ -142,7 +142,7 @@ Same line as categories A/B/C. No `playwright.config.ts`, no `bun x playwright t
|
|
|
142
142
|
|
|
143
143
|
## Tailwind + shadcn packages
|
|
144
144
|
|
|
145
|
-
For shadcn-based OwlMeans packages the `tests/context.ts` Vite config needs
|
|
145
|
+
For shadcn-based OwlMeans packages the `tests/context.ts` Vite config needs three additions beyond the standard setup:
|
|
146
146
|
|
|
147
147
|
```ts
|
|
148
148
|
import tailwindcss from '@tailwindcss/vite'
|
|
@@ -154,11 +154,14 @@ const server = await createServer({
|
|
|
154
154
|
plugins: [react(), tailwindcss()], // add Tailwind v4 Vite plugin
|
|
155
155
|
resolve: {
|
|
156
156
|
alias: { '@': resolve(here, '../src/@') }, // resolve @/ to the package's local copy
|
|
157
|
+
dedupe: ['react', 'react-dom'], // one React across the workspace links
|
|
157
158
|
},
|
|
158
159
|
server: { port: 0 },
|
|
159
160
|
})
|
|
160
161
|
```
|
|
161
162
|
|
|
163
|
+
`dedupe` is not optional in a workspace: symlinked sibling packages otherwise resolve their own React copy and every hook throws.
|
|
164
|
+
|
|
162
165
|
`tests/harness/mount.tsx` imports the package CSS so components render with Tailwind styles:
|
|
163
166
|
|
|
164
167
|
```tsx
|
|
@@ -166,6 +169,15 @@ import '../../src/@/globals.css'
|
|
|
166
169
|
// ... dynamic component mounting ...
|
|
167
170
|
```
|
|
168
171
|
|
|
172
|
+
### Testing routed UI (navigation, layouts)
|
|
173
|
+
|
|
174
|
+
A spec that exercises navigation opens a **path** on the harness origin instead of a `?component=` query, and `mount.tsx` builds a real context with real entrypoints — the OwlMeans router drives the History API, so nothing about the routing may be faked. Two shapes the harness must get right, because a spec that trips them fails obscurely:
|
|
175
|
+
|
|
176
|
+
- **Leave the context un-initialized** (`ready` false). The Router compiles the entrypoint tree into routes only while the context is un-initialized; a pre-readied context renders a blank page.
|
|
177
|
+
- **Give every entrypoint that has children one child declared `default: true`**, or the parent's own path renders blank.
|
|
178
|
+
|
|
179
|
+
Include the framework's own `modules` in the harness entrypoint list: the panel context registers the api-config middleware, which resolves one of them during init and throws before any route is compiled if they are missing.
|
|
180
|
+
|
|
169
181
|
Shadcn components are plain React — no theme provider needed. Assert via `getByRole` / text as usual. To verify that Tailwind classes took visual effect, read computed styles:
|
|
170
182
|
|
|
171
183
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/test-ui",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@owlmeans/auth": "^0.1.18-rc.6",
|
|
26
|
-
"@owlmeans/basic-envelope": "^0.1.18-rc.
|
|
26
|
+
"@owlmeans/basic-envelope": "^0.1.18-rc.7",
|
|
27
27
|
"@owlmeans/basic-ids": "^0.1.18-rc.6",
|
|
28
|
-
"@owlmeans/basic-keys": "^0.1.18-rc.
|
|
28
|
+
"@owlmeans/basic-keys": "^0.1.18-rc.7",
|
|
29
29
|
"@owlmeans/test": "^0.1.18-rc.6",
|
|
30
|
-
"@owlmeans/test-auth": "^0.1.18-rc.
|
|
30
|
+
"@owlmeans/test-auth": "^0.1.18-rc.7",
|
|
31
31
|
"playwright": "^1.61.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|