Skip to content

Add WNPRC_EHRTest for Time of Day lovcombo multi-select#982

Merged
labkey-martyp merged 5 commits into
release26.3-SNAPSHOTfrom
26.3_fb_lovcombo_timeofday_1266
Jun 29, 2026
Merged

Add WNPRC_EHRTest for Time of Day lovcombo multi-select#982
labkey-martyp merged 5 commits into
release26.3-SNAPSHOTfrom
26.3_fb_lovcombo_timeofday_1266

Conversation

@labkey-martyp

@labkey-martyp labkey-martyp commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Rationale

Adds end-to-end test coverage for the LovCombo fix in https://github.com/LabKey/internal-issues/issues/1266. The "Time of Day" multi-select on the Treatments task's Import Scheduled Treatments dialog is a string-valued lovcombo; before the fix its selections were silently dropped and Submit failed validation with "Must provide room and time of day".

Related Pull Requests

Changes

  • WNPRC_EHR/test/src/org/labkey/test/tests/wnprc_ehr/WNPRC_EHRTest.java: add testTreatmentTimeOfDayMultiSelect, which opens the dialog, selects multiple Time of Day values, asserts the selection is retained, and submits — expecting the "No uncompleted treatments were found." alert rather than the pre-fix "Must provide room and time of day" validation alert.

Adds testTreatmentTimeOfDayMultiSelect: opens the Treatments task Import Scheduled Treatments dialog, selects multiple Time of Day values in the string-valued lovcombo, and submits. It asserts the selection is retained and reaches the schedule query (alert 'No uncompleted treatments were found.') rather than the pre-fix validation alert 'Must provide room and time of day'. Exercises the LovCombo fix end-to-end.

LabKey/internal-issues#1266
labkey-martyp added a commit to LabKey/platform that referenced this pull request Jun 29, 2026
…7796)

## Rationale

Newer browsers (Chrome, Firefox 140+) ship a native `RegExp.escape` that
throws a `TypeError` on non-String input.
`Ext.ux.form.LovCombo.setValue()` passed `JSON.stringify(value)` to
`RegExp.escape` to avoid that crash, but `JSON.stringify()` quotes
string values, so they no longer matched the raw, unquoted output of
`getCheckedValue()` and every selection in a string-valued combo (e.g.
the WNPRC EHR Time of Day multi-select) was silently dropped. Using
`String()` yields a valid String for `RegExp.escape` without quoting
string values, fixing both the numeric-`valueField` crash and the
string-`valueField` regression. See
LabKey/internal-issues#1266.

## Related Pull Requests

- LabKey/wnprc-modules#982
- LabKey/premiumModules#638

## Changes

- `core/webapp/Ext.ux.form.LovCombo.js`: in `setValue()`, pass
`String(...)` rather than `JSON.stringify(...)` to `RegExp.escape`.
@labkey-martyp labkey-martyp merged commit df9f8ff into release26.3-SNAPSHOT Jun 29, 2026
5 of 7 checks passed
@labkey-martyp labkey-martyp deleted the 26.3_fb_lovcombo_timeofday_1266 branch June 29, 2026 04:19

@labkey-martyp labkey-martyp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants