@rvoh/psychic-spec-helpers 3.2.0 → 3.2.1

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.
@@ -14,6 +14,16 @@ export default async function getAllTextContentFromPage(page, selector = 'body')
14
14
  const tagName = String(element.tagName || '').toLowerCase();
15
15
  if (['script', 'style', 'noscript'].includes(tagName))
16
16
  return;
17
+ // Form-control values (input/textarea) are not part of innerText or
18
+ // textContent, but the previous ::-p-text()-based matcher matched them
19
+ // and callers assert on entered values, so include them explicitly.
20
+ if (tagName === 'input' || tagName === 'textarea') {
21
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
22
+ const value = element.value?.trim();
23
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
24
+ if (value)
25
+ textContentArray.push(value);
26
+ }
17
27
  let elementText;
18
28
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
19
29
  if (typeof element.innerText === 'string') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@rvoh/psychic-spec-helpers",
4
- "version": "3.2.0",
4
+ "version": "3.2.1",
5
5
  "description": "psychic framework spec helpers",
6
6
  "author": "RVO Health",
7
7
  "repository": {
@@ -20,6 +20,16 @@ export default async function getAllTextContentFromPage(page: Page, selector = '
20
20
  const tagName = String(element.tagName || '').toLowerCase()
21
21
  if (['script', 'style', 'noscript'].includes(tagName)) return
22
22
 
23
+ // Form-control values (input/textarea) are not part of innerText or
24
+ // textContent, but the previous ::-p-text()-based matcher matched them
25
+ // and callers assert on entered values, so include them explicitly.
26
+ if (tagName === 'input' || tagName === 'textarea') {
27
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
28
+ const value = element.value?.trim()
29
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
30
+ if (value) textContentArray.push(value)
31
+ }
32
+
23
33
  let elementText: string | undefined
24
34
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
25
35
  if (typeof element.innerText === 'string') {