@@ -210,8 +210,10 @@ describe("SideChannelsTab", () => {
210210 const onApply = vi . fn ( ) ;
211211 render ( < SideChannelsTab sideChannels = { INITIAL_SPEC . side_channels }
212212 availableChannels = { [ "doc_ids" , "token_ids" ] }
213+ selectedTrainChannels = { [ ] }
213214 gotchas = { [ ] }
214- onApply = { onApply } /> ) ;
215+ onApply = { onApply }
216+ onTrainChannelsChange = { ( ) => { } } /> ) ;
215217 fireEvent . change ( screen . getByTestId ( "side-channel-family-platform-mode" ) ,
216218 { target : { value : "require" } } ) ;
217219 fireEvent . change ( screen . getByTestId ( "side-channel-family-platform-dropout" ) ,
@@ -228,8 +230,10 @@ describe("SideChannelsTab", () => {
228230 it ( "renders inference and platform preview controls" , ( ) => {
229231 render ( < SideChannelsTab sideChannels = { INITIAL_SPEC . side_channels }
230232 availableChannels = { [ "platform_ids" ] }
233+ selectedTrainChannels = { [ ] }
231234 gotchas = { [ ] }
232- onApply = { ( ) => { } } /> ) ;
235+ onApply = { ( ) => { } }
236+ onTrainChannelsChange = { ( ) => { } } /> ) ;
233237 fireEvent . change ( screen . getByTestId ( "side-channel-inference-source" ) ,
234238 { target : { value : "parse_if_possible" } } ) ;
235239 fireEvent . change ( screen . getByTestId ( "side-channel-platform-os" ) ,
@@ -243,16 +247,34 @@ describe("SideChannelsTab", () => {
243247 it ( "surfaces required-family contract probe errors" , ( ) => {
244248 render ( < SideChannelsTab sideChannels = { INITIAL_SPEC . side_channels }
245249 availableChannels = { [ ] }
250+ selectedTrainChannels = { [ ] }
246251 gotchas = { [ {
247252 id : "side_channel_required_platform" ,
248253 severity : "error" ,
249254 message : "required side-channel family 'platform'" ,
250255 } ] }
251- onApply = { ( ) => { } } /> ) ;
256+ onApply = { ( ) => { } }
257+ onTrainChannelsChange = { ( ) => { } } /> ) ;
252258 expect ( screen . getByTestId (
253259 "side-channel-probe-error-side_channel_required_platform" ,
254260 ) . textContent ) . toContain ( "platform" ) ;
255261 } ) ;
262+
263+ it ( "selects train side-channel inputs inside the side-channel tab" , ( ) => {
264+ const onTrainChannelsChange = vi . fn ( ) ;
265+ render ( < SideChannelsTab sideChannels = { INITIAL_SPEC . side_channels }
266+ availableChannels = { [ "doc_ids" , "token_ids" ] }
267+ selectedTrainChannels = { [ "doc_ids" ] }
268+ gotchas = { [ ] }
269+ onApply = { ( ) => { } }
270+ onTrainChannelsChange = { onTrainChannelsChange } /> ) ;
271+ expect ( screen . getByTestId ( "side-channel-train-doc_ids" ) )
272+ . toHaveProperty ( "checked" , true ) ;
273+ fireEvent . click ( screen . getByTestId ( "side-channel-train-token_ids" ) ) ;
274+ expect ( onTrainChannelsChange ) . toHaveBeenCalledWith ( [
275+ "doc_ids" , "token_ids" ,
276+ ] ) ;
277+ } ) ;
256278} ) ;
257279
258280describe ( "Sidebar" , ( ) => {
@@ -261,12 +283,14 @@ describe("Sidebar", () => {
261283 rewriters : INITIAL_SPEC . rewriters ,
262284 sideChannels : INITIAL_SPEC . side_channels ,
263285 availableSideChannels : [ "doc_ids" , "token_ids" ] ,
286+ selectedTrainSideChannels : [ ] ,
264287 sharding : INITIAL_SPEC . sharding ,
265288 gotchas : INITIAL_SPEC . gotchas , proposals : [ ] ,
266289 onLossApply : ( ) => { } , onOptimApply : ( ) => { } ,
267290 onRewriterAdd : ( ) => { } , onRewriterRemove : ( ) => { } ,
268291 onRewriterReorder : ( ) => { } ,
269292 onSideChannelsApply : ( ) => { } ,
293+ onTrainSideChannelsChange : ( ) => { } ,
270294 onShardingChange : ( ) => { } , onShardingAccept : ( ) => { } ,
271295 } ;
272296
0 commit comments