@adobe/data-lit 0.9.82 → 0.9.84
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/dist/elements/database-element.d.ts +9 -0
- package/dist/elements/database-element.js +35 -1
- package/dist/elements/database-element.js.map +1 -1
- package/dist/elements/database-element.type-test.js +6 -0
- package/dist/elements/database-element.type-test.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/testing/template/from.d.ts +7 -0
- package/dist/testing/template/from.js +90 -0
- package/dist/testing/template/from.js.map +1 -0
- package/dist/testing/template/from.test.d.ts +1 -0
- package/dist/testing/template/from.test.js +41 -0
- package/dist/testing/template/from.test.js.map +1 -0
- package/dist/testing/template/public.d.ts +2 -0
- package/dist/testing/template/public.js +3 -0
- package/dist/testing/template/public.js.map +1 -0
- package/dist/testing/template/query.d.ts +25 -0
- package/dist/testing/template/query.js +3 -0
- package/dist/testing/template/query.js.map +1 -0
- package/dist/testing/template/template.d.ts +1 -0
- package/dist/testing/template/template.js +5 -0
- package/dist/testing/template/template.js.map +1 -0
- package/package.json +7 -3
- package/src/elements/database-element.ts +36 -1
- package/src/elements/database-element.type-test.ts +20 -0
- package/src/index.ts +1 -0
- package/src/testing/template/from.test.ts +47 -0
- package/src/testing/template/from.ts +86 -0
- package/src/testing/template/public.ts +3 -0
- package/src/testing/template/query.ts +27 -0
- package/src/testing/template/template.ts +4 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A DOM-free view over a Lit `TemplateResult`, for asserting on what a pure
|
|
5
|
+
* `render(props)` presentation *declares* — without mounting anything. Built by
|
|
6
|
+
* `Template.from`.
|
|
7
|
+
*
|
|
8
|
+
* - `text` — all static markup plus interpolated primitives, concatenated
|
|
9
|
+
* (recursive). Use for presence: `q.has("<sp-toast")`, `q.text`.
|
|
10
|
+
* - `values` — every leaf binding value, flattened across nested templates in
|
|
11
|
+
* source order (nested templates themselves are excluded — they live in
|
|
12
|
+
* `children`). Use identity checks rather than positions:
|
|
13
|
+
* `expect(q.values).toContain(onClick)`, `.toContain(nothing)`.
|
|
14
|
+
* - `children` — the interpolated child templates (`${html`…`}`), each wrapped.
|
|
15
|
+
* - `has` / `find` — presence sugar and a recursive lookup of the first child
|
|
16
|
+
* template whose `text` includes a fragment.
|
|
17
|
+
*
|
|
18
|
+
* Note: `find` only sees *interpolated* sub-templates; elements written inline
|
|
19
|
+
* in a single `html` literal are part of `text`, not `children`.
|
|
20
|
+
*/
|
|
21
|
+
export type Query = {
|
|
22
|
+
readonly text: string;
|
|
23
|
+
readonly values: readonly unknown[];
|
|
24
|
+
readonly children: readonly Query[];
|
|
25
|
+
has(fragment: string): boolean;
|
|
26
|
+
find(fragment: string): Query | undefined;
|
|
27
|
+
};
|