extractValue method infrastructure ✓ 100.0%

Last updated: 2026-03-04T23:21:38.391Z

Metrics

LOC: 20 Complexity: 5 Params: 1 Coverage: 100.0% (8/8 lines, 12x executed)

Signature

extractValue(wrapper: HTMLElement): : string | null

Source Code

  extractValue(wrapper: HTMLElement): string | null {
    // hidden input usually holds the real value(s)
    const hidden = wrapper.querySelector<HTMLInputElement>(
      ":scope > input[type='hidden'], :scope > div > input[type='hidden']",
    );
    if (hidden && hidden.value) return hidden.value;

    // multi-select labels
    const tags = wrapper.querySelectorAll<HTMLElement>(
      ".react-select__multi-value__label",
    );
    if (tags.length > 0) {
      return Array.from(tags)
        .map((t) => t.textContent?.trim() ?? "")
        .filter((t) => t)
        .join(",");
    }

    return null;
  },

No outgoing dependencies.

No incoming dependencies.