@@ -526,6 +526,42 @@ describe('MissingModelRow', () => {
526526 )
527527 } )
528528
529+ it ( 'falls back when the Desktop bridge rejects' , async ( ) => {
530+ mockIsCloud . value = false
531+ const user = userEvent . setup ( )
532+ const error = new Error ( 'Desktop bridge unavailable' )
533+ const consoleErrorSpy = vi
534+ . spyOn ( console , 'error' )
535+ . mockImplementation ( ( ) => { } )
536+ window . __comfyDesktop2 = {
537+ isRemote : ( ) => false ,
538+ openModelAccessPage : vi . fn ( ) . mockRejectedValue ( error )
539+ }
540+ const model = makeModel ( [ { nodeId : '1' , widgetName : 'ckpt_name' } ] )
541+ model . representative . url =
542+ 'https://huggingface.co/bfl/FLUX.1/resolve/main/model.safetensors'
543+
544+ renderRow ( model , vi . fn ( ) , false )
545+ useMissingModelStore ( ) . setGatedRepoUrl (
546+ model . representative . url ,
547+ 'https://huggingface.co/bfl/FLUX.1'
548+ )
549+ await nextTick ( )
550+
551+ await user . click ( screen . getByTestId ( 'missing-model-gated-access' ) )
552+
553+ await waitFor ( ( ) => {
554+ expect ( mockOpenGatedRepoPage ) . toHaveBeenCalledWith (
555+ 'https://huggingface.co/bfl/FLUX.1'
556+ )
557+ } )
558+ expect ( consoleErrorSpy ) . toHaveBeenCalledWith (
559+ 'Failed to open model access page in Desktop:' ,
560+ error
561+ )
562+ consoleErrorSpy . mockRestore ( )
563+ } )
564+
529565 it ( 'shows unknown category metadata for models without a directory' , ( ) => {
530566 renderRow (
531567 makeModel ( [ { nodeId : '1' , widgetName : 'ckpt_name' } ] ) ,
0 commit comments