@@ -96,9 +96,19 @@ describe("ComposerTasksBadge", () => {
9696 ) ;
9797
9898 expect ( markup ) . toContain ( 'data-chat-composer-tasks-drawer="true"' ) ;
99+ expect ( markup ) . toContain ( 'data-chat-composer-collapsed-controls="true"' ) ;
99100 expect ( markup ) . not . toContain ( "data-variant" ) ;
100101 expect ( markup ) . toContain ( 'aria-expanded="true"' ) ;
102+ expect ( markup ) . toContain ( 'aria-label="Collapse tasks. 1 of 3 complete."' ) ;
103+ expect ( markup ) . toContain ( 'aria-label="Task list. 1 of 3 complete."' ) ;
101104 expect ( markup ) . toContain ( 'role="list"' ) ;
105+ expect ( markup ) . toContain ( 'data-composer-tasks-list="true"' ) ;
106+ expect ( markup ) . toContain ( 'tabindex="0"' ) ;
107+ expect ( markup ) . toContain ( "max-h-[min(24rem,40dvh)]" ) ;
108+ expect ( markup ) . toContain ( "overflow-y-auto" ) ;
109+ expect ( markup ) . toContain ( "overscroll-contain" ) ;
110+ expect ( markup ) . toContain ( "focus-visible:ring-2" ) ;
111+ expect ( markup ) . toContain ( "focus-visible:ring-inset" ) ;
102112 expect ( markup ) . toContain ( "Inspect the composer" ) ;
103113 expect ( markup ) . toContain ( 'data-composer-task-duration="true"' ) ;
104114 expect ( markup ) . toContain ( "ml-auto w-10" ) ;
@@ -107,13 +117,32 @@ describe("ComposerTasksBadge", () => {
107117 expect ( markup ) . toContain ( "Attach task progress" ) ;
108118 expect ( markup ) . toContain ( "Verify the result" ) ;
109119 expect ( markup ) . toContain ( "lucide-list-todo" ) ;
120+ expect ( markup ) . toContain ( "lucide-chevron-down" ) ;
110121 expect ( markup ) . toContain ( 'aria-label="Dismiss tasks for this turn"' ) ;
111- expect ( markup ) . not . toContain ( "lucide-chevron" ) ;
112122 expect ( markup ) . not . toContain ( "bg-success" ) ;
113123 expect ( markup ) . not . toContain ( "bg-primary" ) ;
114124 expect ( markup ) . not . toContain ( "bg-muted-foreground/25" ) ;
115125 } ) ;
116126
127+ it ( "keeps every long-list task inside the bounded scroll region" , ( ) => {
128+ const longSteps = Array . from ( { length : 20 } , ( _ , index ) => ( {
129+ step : `Task ${ index + 1 } ` ,
130+ status : index === 0 ? ( "inProgress" as const ) : ( "pending" as const ) ,
131+ } ) ) ;
132+ const markup = renderToStaticMarkup (
133+ < ComposerTasksDrawer
134+ onCollapse = { ( ) => undefined }
135+ onDismiss = { ( ) => undefined }
136+ progress = { { step : "Task 1" , completedSteps : 0 , totalSteps : longSteps . length } }
137+ steps = { longSteps }
138+ /> ,
139+ ) ;
140+
141+ const listStart = markup . indexOf ( 'data-composer-tasks-list="true"' ) ;
142+ expect ( listStart ) . toBeGreaterThan ( markup . indexOf ( 'aria-label="Collapse tasks.' ) ) ;
143+ expect ( markup . slice ( listStart ) ) . toContain ( "Task 20" ) ;
144+ } ) ;
145+
117146 it ( "does not render an empty task count" , ( ) => {
118147 const markup = renderToStaticMarkup (
119148 < ComposerTasksBadge
0 commit comments