@@ -16,6 +16,7 @@ import { SingleTaskLabelLines } from '../SingleTaskLabelLines';
1616// ── mocks ────────────────────────────────────────────────────────────────────
1717
1818vi . mock ( '@mantine/core' , ( ) => ( {
19+ Box : ( { children } : { children : ReactNode } ) => < div > { children } </ div > ,
1920 Center : ( { children } : { children : ReactNode } ) => < div > { children } </ div > ,
2021 Stack : ( { children } : { children : ReactNode } ) => < div > { children } </ div > ,
2122 Tooltip : ( { children, label } : { children : ReactNode ; label ?: ReactNode } ) => (
@@ -137,13 +138,15 @@ describe('SingleTask', () => {
137138 < svg > < SingleTask { ...baseProps } answerStatus = "correct" /> </ svg > ,
138139 ) ;
139140 expect ( html ) . toContain ( 'icon-check' ) ;
141+ expect ( html ) . toContain ( 'fill="#bfe8c6"' ) ;
140142 } ) ;
141143
142144 test ( 'shows x icon for an incorrect response' , ( ) => {
143145 const html = renderToStaticMarkup (
144146 < svg > < SingleTask { ...baseProps } answerStatus = "incorrect" /> </ svg > ,
145147 ) ;
146148 expect ( html ) . toContain ( 'icon-x' ) ;
149+ expect ( html ) . toContain ( 'fill="#f3c1c1"' ) ;
147150 } ) ;
148151
149152 test ( 'shows an accessible grey checkmark for an unknown response' , ( ) => {
@@ -153,6 +156,7 @@ describe('SingleTask', () => {
153156 expect ( html ) . toContain ( 'icon-check' ) ;
154157 expect ( html ) . toContain ( 'var(--mantine-color-gray-6)' ) ;
155158 expect ( html ) . toContain ( 'Response recorded; correctness not configured.' ) ;
159+ expect ( html ) . toContain ( 'fill="lightgray"' ) ;
156160 } ) ;
157161
158162 test ( 'shows microphone icon when hasAudio' , ( ) => {
@@ -277,6 +281,39 @@ describe('AllTasksTimeline', () => {
277281 expect ( html ) . toContain ( '<rect' ) ;
278282 } ) ;
279283
284+ test ( 'uses equal-width task slots and omits browsed-away intervals in uniform mode' , ( ) => {
285+ const participant = makeParticipant ( {
286+ answers : {
287+ trial1_0 : makeAnswer ( {
288+ windowEvents : [
289+ [ t0 + 1_000 , 'visibility' , 'hidden' ] ,
290+ [ t0 + 3_000 , 'visibility' , 'visible' ] ,
291+ ] ,
292+ } ) ,
293+ trial2_1 : makeAnswer ( {
294+ componentName : 'trial2' ,
295+ trialOrder : '1_0' ,
296+ startTime : t0 + 20_000 ,
297+ endTime : t0 + 40_000 ,
298+ } ) ,
299+ } ,
300+ } ) ;
301+
302+ const html = renderToStaticMarkup (
303+ < AllTasksTimeline
304+ participantData = { participant }
305+ width = { 600 }
306+ studyId = "test-study"
307+ studyConfig = { emptyConfig }
308+ maxLength = { undefined }
309+ timelineMode = "uniform"
310+ /> ,
311+ ) ;
312+
313+ expect ( html ) . toContain ( 'width:136px' ) ;
314+ expect ( html ) . not . toContain ( 'Browsed away' ) ;
315+ } ) ;
316+
280317 test ( 'handles all tracked window event types without error' , ( ) => {
281318 const participant = makeParticipant ( {
282319 answers : {
0 commit comments