@adobe/data-lit 0.9.83 → 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.
Files changed (33) hide show
  1. package/dist/elements/database-element.d.ts +9 -0
  2. package/dist/elements/database-element.js +35 -1
  3. package/dist/elements/database-element.js.map +1 -1
  4. package/dist/elements/database-element.type-test.js +6 -0
  5. package/dist/elements/database-element.type-test.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/testing/template/from.d.ts +7 -0
  10. package/dist/testing/template/from.js +90 -0
  11. package/dist/testing/template/from.js.map +1 -0
  12. package/dist/testing/template/from.test.d.ts +1 -0
  13. package/dist/testing/template/from.test.js +41 -0
  14. package/dist/testing/template/from.test.js.map +1 -0
  15. package/dist/testing/template/public.d.ts +2 -0
  16. package/dist/testing/template/public.js +3 -0
  17. package/dist/testing/template/public.js.map +1 -0
  18. package/dist/testing/template/query.d.ts +25 -0
  19. package/dist/testing/template/query.js +3 -0
  20. package/dist/testing/template/query.js.map +1 -0
  21. package/dist/testing/template/template.d.ts +1 -0
  22. package/dist/testing/template/template.js +5 -0
  23. package/dist/testing/template/template.js.map +1 -0
  24. package/package.json +7 -3
  25. package/src/elements/database-element.ts +36 -1
  26. package/src/elements/database-element.type-test.ts +20 -0
  27. package/src/index.ts +1 -0
  28. package/src/testing/template/from.test.ts +47 -0
  29. package/src/testing/template/from.ts +86 -0
  30. package/src/testing/template/public.ts +3 -0
  31. package/src/testing/template/query.ts +27 -0
  32. package/src/testing/template/template.ts +4 -0
  33. 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
+ };
@@ -0,0 +1,4 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ // DOM-free querying of a Lit `TemplateResult` for presentation unit tests.
3
+ // Pure (no side effects) so it tree-shakes out of production bundles.
4
+ export * as Template from "./public.js";