File tree Expand file tree Collapse file tree
packages/backend.ai-docs-toolkit/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,3 +59,23 @@ test("buildWebDocument — works without config (preview-mode default branding)"
5959 const html = buildWebDocument ( sampleChapters , meta ) ;
6060 assert . ok ( html . length > 0 ) ;
6161} ) ;
62+
63+ test ( "buildWebDocument — wraps sidebar nav inside .doc-sidebar__scroll (FR-2768 regression guard)" , ( ) => {
64+ // FR-2768 made .doc-sidebar a fixed-height, overflow:hidden flex column and
65+ // delegated scrolling to an inner .doc-sidebar__scroll element. If the nav
66+ // is not wrapped in that element, the sidebar can't scroll on overflow.
67+ const html = buildWebDocument ( sampleChapters , meta ) ;
68+
69+ const sidebarMatch = html . match ( / < a s i d e c l a s s = " d o c - s i d e b a r " > [ \s \S ] * ?< \/ a s i d e > / ) ;
70+ assert . ok ( sidebarMatch , ".doc-sidebar aside not found" ) ;
71+ const sidebarHtml = sidebarMatch [ 0 ] ;
72+
73+ const scrollIdx = sidebarHtml . indexOf ( 'class="doc-sidebar__scroll"' ) ;
74+ const navIdx = sidebarHtml . indexOf ( 'class="doc-sidebar-nav"' ) ;
75+ assert . notStrictEqual ( scrollIdx , - 1 , ".doc-sidebar__scroll wrapper missing from sidebar" ) ;
76+ assert . notStrictEqual ( navIdx , - 1 , ".doc-sidebar-nav missing from sidebar" ) ;
77+ assert . ok (
78+ scrollIdx < navIdx ,
79+ ".doc-sidebar-nav must be nested inside the .doc-sidebar__scroll wrapper" ,
80+ ) ;
81+ } ) ;
You can’t perform that action at this time.
0 commit comments