@@ -2145,16 +2145,14 @@ describe('RecordDetailView.bodyTablePredicate-27478', () => {
21452145// ── RecordDetailView.relatedCountsFirst-27056 ───────────────────────────────
21462146
21472147/**
2148- * objectstack#27056, as objectstack#35595/#35596 lay the page out — the related
2149- * lists load counts first and never block the details. Every list is a tab;
2150- * the 概览 tab's right rail lists, under 「其他相关」, the lists that have
2151- * records, with their first three rows. Measured:
2148+ * objectstack#27056, as objectstack#35890 lays the page out — the related
2149+ * lists load counts first and never block the details. Every list is a tab
2150+ * (the right rail that previewed their first rows is retired). Measured:
21522151 *
21532152 * - the details draw from the record read alone, while every related read is
21542153 * still out, with every list's tab drawn (no number yet) and no rail card;
21552154 * - the six counts go out as ONE request set, before any of them answers;
2156- * - once they answer, rows are read for the lists counted above 0 only, three
2157- * rows each — never for a list counted at 0.
2155+ * - once they answer, no list's rows are read while its tab is closed.
21582156 */
21592157
21602158describe ( 'RecordDetailView.relatedCountsFirst-27056' , ( ) => {
@@ -2334,7 +2332,7 @@ describe('RecordDetailView.relatedCountsFirst-27056', () => {
23342332 expect ( container . querySelector ( '[data-record-summary-other]' ) ) . toBeNull ( ) ;
23352333 } ) ;
23362334
2337- it ( 'asks the six counts as one request set, then three rows of each list counted above 0 only ' , async ( ) => {
2335+ it ( 'asks the six counts as one request set, and no list\'s rows while its tab is closed (objectstack#35890: no rail) ' , async ( ) => {
23382336 const { container } = renderPage ( ) ;
23392337 await idle ( ) ;
23402338 // One request set: every list's count, all out before any answered, and
@@ -2347,25 +2345,14 @@ describe('RecordDetailView.relatedCountsFirst-27056', () => {
23472345 for ( const r of reads . filter ( ( read ) => ! read . answered ) ) r . answer ( ) ;
23482346 } ) ;
23492347 await idle ( ) ;
2350- const rowReads = reads . filter ( isRowRead ) ;
2351- // Every list counted above 0; never the second, counted at 0.
2352- const withRecords = CHILDREN . filter ( ( c ) => TOTALS [ c ] > 0 ) ;
2353- expect ( rowReads . map ( ( r ) => r . object ) . sort ( ) ) . toEqual ( [ ...withRecords ] . sort ( ) ) ;
2354- for ( const r of rowReads ) expect ( r . query . $top ) . toBe ( 3 ) ;
2355- expect ( reads . some ( ( r ) => r . object === C2 && isRowRead ( r ) ) ) . toBe ( false ) ;
2356-
2357- await act ( async ( ) => {
2358- for ( const r of reads . filter ( ( read ) => ! read . answered ) ) r . answer ( ) ;
2359- } ) ;
2360- await idle ( ) ;
2361- const rail = column ( container , 'right' ) ! ;
2362- const rowsOf = ( c : string ) =>
2363- rail . querySelector ( `[data-record-summary-card="${ c } .account"]` ) ?. querySelectorAll ( '[data-record-summary-row]' ) ?? [ ] ;
2364- expect ( rowsOf ( C1 ) ) . toHaveLength ( 3 ) ;
2365- expect ( rowsOf ( C3 ) ) . toHaveLength ( 2 ) ;
2366- // CONTROL: the list counted at 0 has no rail card at all, but keeps its tab.
2367- expect ( rail . querySelector ( `[data-record-summary-card="${ C2 } .account"]` ) ) . toBeNull ( ) ;
2348+ // objectstack#35890 — the rail that drew three rows of each list is
2349+ // retired: on 「详情」 no list's rows are read, counted above 0 or not.
2350+ expect ( reads . filter ( isRowRead ) ) . toEqual ( [ ] ) ;
2351+ expect ( column ( container , 'right' ) ) . toBeNull ( ) ;
2352+ expect ( container . querySelector ( '[data-record-summary-card]' ) ) . toBeNull ( ) ;
2353+ // CONTROL: the list counted at 0 keeps its tab, marked empty.
23682354 expect ( container . querySelector ( `[data-record-tab="${ C2 } .account"]` ) ?. hasAttribute ( 'data-record-tab-empty' ) ) . toBe ( true ) ;
2355+ expect ( container . querySelector ( `[data-record-tab="${ C1 } .account"]` ) ?. hasAttribute ( 'data-record-tab-empty' ) ) . toBe ( false ) ;
23692356 } ) ;
23702357 } ) ;
23712358} ) ;
0 commit comments