@@ -129,4 +129,46 @@ describe("MultiChannel", () => {
129129 cy . log ( "Channel visibility toggling works correctly" ) ;
130130 } ) ;
131131 } ) ;
132+ it ( "should align MultiChannel x-axis with standard Channel" , ( ) => {
133+ // Config with one outside channel for comparison and MultiChannel with showYAxis=false
134+ const config = multiChannwlCnfig . replace (
135+ "<MultiChannel>" ,
136+ '<Channel column="velocity" legend="Standalone"/><MultiChannel showYAxis="false">' ,
137+ ) ;
138+
139+ cy . log ( "Initialize MultiChannel TimeSeries for alignment reproduction" ) ;
140+ LabelStudio . params ( ) . config ( config ) . data ( multiChannelSampleData ) . withResult ( [ ] ) . init ( ) ;
141+
142+ LabelStudio . waitForObjectsReady ( ) ;
143+ TimeSeries . waitForReady ( ) ;
144+
145+ // Verify paths are present
146+ TimeSeries . paths . should ( "have.length.greaterThan" , 0 ) ;
147+
148+ // Get the first plot (Sensor A / Standalone)
149+ cy . get ( ".htx-timeseries-channel:not(.htx-timeseries-multichannel *) path" )
150+ . first ( )
151+ . then ( ( $pathA ) => {
152+ const d_A = $pathA . attr ( "d" ) ;
153+ const firstPointA_X = Number . parseFloat ( d_A . substring ( 1 ) . split ( "," ) [ 0 ] ) ;
154+
155+ // Get the path for channel inside MultiChannel
156+ cy . get ( ".htx-timeseries-multichannel path" )
157+ . first ( )
158+ . then ( ( $pathB ) => {
159+ const d_B = $pathB . attr ( "d" ) ;
160+ const firstPointB_X = Number . parseFloat ( d_B . substring ( 1 ) . split ( "," ) [ 0 ] ) ;
161+
162+ cy . log ( `Sensor A First Point X: ${ firstPointA_X } ` ) ;
163+ cy . log ( `Sensor B First Point X: ${ firstPointB_X } ` ) ;
164+
165+ if ( Math . abs ( firstPointB_X - firstPointA_X ) > 1 ) {
166+ console . error ( `Mismatch! A: ${ firstPointA_X } , B: ${ firstPointB_X } ` ) ;
167+ }
168+
169+ // Tolerance of 1px
170+ expect ( firstPointB_X , `Mismatch! A: ${ firstPointA_X } , B: ${ firstPointB_X } ` ) . to . be . closeTo ( firstPointA_X , 1 ) ;
171+ } ) ;
172+ } ) ;
173+ } ) ;
132174} ) ;
0 commit comments