@unotest/web 0.49.1 → 0.49.2

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.
@@ -1,6 +1,6 @@
1
1
  import { InjectedDomHelpers } from '@unotest/grounder-client/dom-walker';
2
2
  import { PickerMode } from '@unotest/protocol';
3
- import { E as ElementHint } from '../interfaces-D5ePwBX6.js';
3
+ import { E as ElementHint } from '../interfaces-mlRtu8mL.js';
4
4
  import '../config/schema.js';
5
5
  import 'zod';
6
6
 
@@ -2775,15 +2775,21 @@ function pasteValue(el, pasted) {
2775
2775
  __name(pasteValue, "pasteValue");
2776
2776
  function readCheckedState(el) {
2777
2777
  globalThis.__name ??= (fn) => fn;
2778
- const input = el;
2779
- if (input.tagName === "INPUT" && (input.type === "checkbox" || input.type === "radio")) {
2780
- return input.checked;
2781
- }
2782
- const role = el.getAttribute("role");
2783
- if (role === "checkbox" || role === "radio" || role === "switch") {
2784
- return el.getAttribute("aria-checked") === "true";
2785
- }
2786
- return null;
2778
+ const own = /* @__PURE__ */ __name((node) => {
2779
+ const input = node;
2780
+ if (input.tagName === "INPUT" && (input.type === "checkbox" || input.type === "radio")) {
2781
+ return input.checked;
2782
+ }
2783
+ const role = node.getAttribute("role");
2784
+ if (role === "checkbox" || role === "radio" || role === "switch") {
2785
+ return node.getAttribute("aria-checked") === "true";
2786
+ }
2787
+ return null;
2788
+ }, "own");
2789
+ const state = own(el);
2790
+ if (state !== null) return state;
2791
+ const control = el.closest("label")?.control;
2792
+ return control ? own(control) : null;
2787
2793
  }
2788
2794
  __name(readCheckedState, "readCheckedState");
2789
2795
  function readDisabledState(el) {
@@ -9,6 +9,13 @@ type LocatorStep = {
9
9
  role: string;
10
10
  name?: Matcher;
11
11
  exact?: boolean;
12
+ checked?: boolean;
13
+ disabled?: boolean;
14
+ expanded?: boolean;
15
+ includeHidden?: boolean;
16
+ level?: number;
17
+ pressed?: boolean;
18
+ selected?: boolean;
12
19
  } | {
13
20
  kind: 'getByText';
14
21
  text: Matcher;
@@ -629,6 +636,9 @@ interface DriverPage {
629
636
  clipboardPaste(loc: LocatorValue, text: string): Promise<void>;
630
637
  count(loc: LocatorValue): Promise<number>;
631
638
  textContent(loc: LocatorValue): Promise<string | null>;
639
+ /** `textContent` of every match, in DOM order; `[]` when nothing
640
+ * matches. One read, no wait — a query, not an assertion. */
641
+ textContents(loc: LocatorValue): Promise<string[]>;
632
642
  /** RENDERED text: line breaks preserved, `display:none` subtrees and
633
643
  * `<script>`/`<style>` excluded. What a human reads on screen —
634
644
  * `textContent` is the raw source-order concatenation and answers a