fe79fa58f3040e69e5ac3fa38037674b007d2e61
braney
  Sat Sep 12 13:47:50 2026 -0700
docent: ten regression tests for multi-region view, refs #38252

One script per Closed multi-region ticket, asserting the behavior the ticket
says is correct, on genome-test.  Before these the only script here that
entered multi-region at all was rm35580, which uses singleAltHaplo to reach a
different bug.

Between them they cover the four modes, the dialog, the custom-region BED
reader, hideEmptySubtracks across windows, and highlights in both directions
across the mode change:

rm22144  the alt-haplotype input is in the dialog, and hgSuggest
type=altOrPatch resolves the ticket's own mhc, apd and NT_187643
rm23922  the Multi-region and Reverse buttons carry class='pressed' while
their mode is on, and lose it on exit
rm26772  a zero-length BED line names itself instead of aborting with
"Window out of range"
rm27855  hg19 GTEx Gene in singleAltHaplo on chr6_cox_hap2 renders and
clicks through instead of freezing
rm29452  the dialog's exit radio is enabled and checked from a normal view,
and selectable from inside exon view (#34776's half, the missing
hgTracks.virtModeType in the dialog's JSON)
rm29787  custom regions in UCSC chrom names work on hs1
rm30833  a highlight survives turning multi-region on
rm34250  a highlight made in multi-region survives exiting, back in chr1
coordinates
rm35472  hideEmptySubtracks over two windows keeps both subtracks that have
items in one of them, and still hides the one with items in neither
rm37175  exon view keeps the last searched transcript

All ten are assertion-only: every fix shipped long ago.  make test is 47 of 47
green, 7m34s.

README.txt gains the two things they cost a red run each.  Never assert on a
title attribute: hgTracks' tooltip code moves it into data-tooltip once the
page's JavaScript has run.  And multi-region is fully reachable from a goto:
URL -- virtModeType, multiRegionsBedInput, singleAltHaploId, virtWinFull,
<composite>.hideEmptySubtracks -- but the dialog is not, because what it
decides is in JavaScript.

Three candidates were rejected and should not be picked again: #32544 was
closed by deferring to #37256 and is not fixed, #27891 needs a track with a
trackDb multiRegionsBedUrl and /gbdb/hg38/covidMuts/covidMuts.regions.bed does
not exist, and #24055's gesture is an ajax visibility change that no Docent
verb makes.

diff --git src/hg/utils/docent/tests/regress/rm23922.docent.yaml src/hg/utils/docent/tests/regress/rm23922.docent.yaml
new file mode 100644
index 00000000000..aad5a69fce1
--- /dev/null
+++ src/hg/utils/docent/tests/regress/rm23922.docent.yaml
@@ -0,0 +1,62 @@
+# #23922 -- the Multi-region and Reverse buttons gave no hint that the browser was in a
+# mode.  The agreement at the 2019-07-29 project meeting was to draw the button depressed
+# while its mode is on, so that a view that is not showing what a user expects says why.
+#
+# The state comes from the server, not from the page: hg/hgTracks/hgTracks.c decides
+#
+#     boolean isPressed = FALSE;
+#     if (differentString(virtModeType, "default"))
+#         isPressed = TRUE;
+#
+# and hButtonNoSubmitMaybePressed() adds class='pressed' (hg/lib/hPrint.c,
+# cgiMakeButtonMaybePressedMaybeSubmit() in lib/cheapcgi.c).  The button's title changes
+# with it as well, but do not assert on that: hgTracks' own tooltip code moves a title
+# attribute into data-tooltip once the page's JavaScript has run, so the title is gone
+# from the live DOM even though it is in the HTML the server sent.  The class survives.
+#
+# Both buttons the ticket names are checked, because the styling is one mechanism and a
+# change to it would take both with it.  The transitions are the two a user makes: in,
+# and back out again.  The noHas: at the end is the one that matters, since a button that
+# is stuck pressed after exiting is the same misinformation as one that never presses.
+proof:
+  - "assertion-only 2026-09-12 -- written from the ticket long after the fix shipped"
+
+target: genome-test
+db: hg38
+position: chr17:43044295-43125364
+reset: true
+fast: true
+steps:
+  - go: chr17:43044295-43125364
+  - hide: all
+  - track: {knownGene: pack}
+
+  # Default view: the button is drawn plain.
+  - expect:
+      rows: [ruler, knownGene]
+      exact: true
+      noHas: '#hgTracksConfigMultiRegionPage.pressed'
+
+  # Exon view.  Any multi-region mode presses the button; exonMostly is the cheapest one
+  # to reach, and it needs no BED and no alt haplotype.
+  - goto: "/cgi-bin/hgTracks?db=hg38&position=chr17%3A43044295-43125364&virtModeType=exonMostly&pix=1100"
+  - expect:
+      rows: [ruler, knownGene]
+      has: '#hgTracksConfigMultiRegionPage.pressed'
+
+  # And out again, which is the radio rm29452 is about.
+  - goto: "/cgi-bin/hgTracks?db=hg38&position=chr17%3A43044295-43125364&virtModeType=default&pix=1100"
+  - expect:
+      rows: [ruler, knownGene]
+      exact: true
+      noHas: '#hgTracksConfigMultiRegionPage.pressed'
+
+  # The other button the ticket names, and the other mode that is easy to be in without
+  # noticing.  `complement=1` alone reverses the DNA rather than the display, so the
+  # variable to set is the one the button itself submits.
+  - goto: "/cgi-bin/hgTracks?db=hg38&position=chr17%3A43044295-43125364&pix=1100&hgt.toggleRevCmplDisp=1"
+  - expect:
+      rows: [ruler, knownGene]
+      exact: true
+      has: '#hgt\.toggleRevCmplDisp.pressed'
+      noHas: '#hgTracksConfigMultiRegionPage.pressed'