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/rm27855.docent.yaml src/hg/utils/docent/tests/regress/rm27855.docent.yaml
new file mode 100644
index 00000000000..4b32c481518
--- /dev/null
+++ src/hg/utils/docent/tests/regress/rm27855.docent.yaml
@@ -0,0 +1,47 @@
+# #27855 -- hgTracks froze when the alt-haplotype multi-region mode was turned on with the
+# GTEx Gene track in pack.  The ticket's steps are hg19, reset, hide all, GTEx Gene to
+# pack, Multi-region, "show one alternate haplotype ... using ID: chr6_cox_hap2", Submit.
+# Galt's fix went out in July 2021; Daniel checked beta on 2021-07-28 and the RR on
+# 2021-08-04.
+#
+# There is no error string to name in a noText:, because the symptom was a page that never
+# came back.  A hang is what a Docent run is already good at catching: every nav waits for
+# load and the run fails on the timeout, so the assertion that matters here is simply that
+# the steps below complete.  What they add is a positive statement about the page that
+# comes back, so that a build which answers quickly with an empty or default view fails
+# too:
+#
+#   - the mode really engaged (the Multi-region button is drawn pressed, see rm23922),
+#   - gtexGene is drawn and the singleAltHaplo view is not silently the whole chromosome
+#     (`exact: true` -- an alt-haplotype view of chr6_cox_hap2 has these two rows only),
+#   - the graph has items you can click through to hgc.
+#
+# hg19 on purpose: chr6_cox_hap2 is an hg19 alt name, and the GTEx Gene track the ticket
+# names is the hg19 one.
+proof:
+  - "assertion-only 2026-09-12 -- written from the ticket long after the fix shipped"
+
+target: genome-test
+db: hg19
+position: chr6:28000000-33000000
+reset: true
+fast: true
+steps:
+  - goto: "/cgi-bin/hgTracks?db=hg19&position=chr6%3A28000000-33000000&pix=1100&hideTracks=1&gtexGene=pack"
+  - expect: {rows: [ruler, gtexGene], exact: true}
+
+  # The mode the ticket froze on.  singleAltHaploId is the cart variable the dialog's
+  # fourth radio writes, and the one rm22144's autocomplete fills in.
+  - goto: "/cgi-bin/hgTracks?db=hg19&pix=1100&virtModeType=singleAltHaplo&singleAltHaploId=chr6_cox_hap2"
+  - expect:
+      rows: [ruler, gtexGene]
+      exact: true
+      has: '#hgTracksConfigMultiRegionPage.pressed'
+      noText: "unexpected current window"
+
+  # The view is not just drawn, it works: a gene in it clicks through to its details.
+  # ABCF1 is named rather than clicked by position, and the assertion is on the item name
+  # rather than on the track's longLabel -- an hgc page that gave up still prints the
+  # longLabel in its own header, so a text: check on that alone passes on a broken one.
+  - click: {track: gtexGene, item: ABCF1}
+  - expect: {text: "ABCF1", url: "g=gtexGene"}