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/rm29787.docent.yaml src/hg/utils/docent/tests/regress/rm29787.docent.yaml
new file mode 100644
index 00000000000..546a37bdc30
--- /dev/null
+++ src/hg/utils/docent/tests/regress/rm29787.docent.yaml
@@ -0,0 +1,46 @@
+# #29787 -- multi-region custom regions could not be given in UCSC chrom names on the T2T
+# assembly.  #29421 had taught the T2T hub to show chr1 instead of CP068277.2 with the
+# trackDb setting `chromAuthority ucsc`, and everything followed that except the custom
+# regions reader, which still looked the name up in the assembly's own sequence names:
+#
+#     Couldn't find chromosome/scaffold chr12 in database
+#     Couldn't find chromosome/scaffold chr1 in database
+#
+# Gerardo closed it on 2025-08-22 on the ground that T2T CHM13v2.0 is now a curated
+# assembly, hs1, and Dan's two test cases work there.  So this asserts hs1 and Dan's two
+# BED lines, which is what the ticket was closed on rather than something near it.  hs1 is
+# still served out of a hub, so its rows come back as hub_<n>_catLiftOffGenesV1 and the
+# plain name below matches by suffix.
+#
+# The warn() this must not raise is in the custom regions reader,
+# hg/hgTracks/hgTracks.c, a few lines above the chromStart check that rm26772 asserts.
+#
+# `virtWinFull=on` asks for the whole virtual chromosome rather than the zoomed-in view a
+# region change lands on by default, so BOTH of the ticket's regions are on screen and
+# both are asserted: KRAS's items for chr12, and the window separator's own box for the
+# chr1 region.  Without it the second region would be off screen and a reader could not
+# tell a region that failed to resolve from one that is merely not in view.  The chr1
+# region is named by its data-tooltip and not by its title: hgTracks writes both, and the
+# page moves the title out of the DOM once its own tooltip code has run.
+proof:
+  - "assertion-only 2026-09-12 -- written from the ticket after it was closed on hs1"
+
+target: genome-test
+db: hs1
+position: chr12:25076496-25122152
+reset: true
+fast: true
+steps:
+  - goto: "/cgi-bin/hgTracks?db=hs1&position=chr12%3A25076496-25122152&pix=1100&hideTracks=1&catLiftOffGenesV1=pack"
+  - expect: {rows: [ruler, catLiftOffGenesV1], exact: true}
+
+  # Dan's two test cases, both in UCSC names.
+  - goto: "/cgi-bin/hgTracks?pix=1100&virtModeType=customUrl&virtWinFull=on&multiRegionsBedInput=chr12%2025076496%2025122152%0Achr1%2010000%2011000%0A"
+  - expect:
+      rows: [ruler, catLiftOffGenesV1]
+      exact: true
+      noText: "Couldn't find chromosome/scaffold"
+      has:
+        - '#hgTracksConfigMultiRegionPage.pressed'
+        - 'area[href*="i=KRAS"]'
+        - 'area[data-tooltip="chr1:10001-11000"]'