@@ -521,6 +521,42 @@ describe("composerDraftStore file attachments", () => {
521521 expect ( draft ?. files . map ( ( file ) => file . id ) ) . toEqual ( [ "file-accepted" ] ) ;
522522 } ) ;
523523
524+ it ( "reattaches a DNG with an older generic-MIME marker at attachment capacity" , ( ) => {
525+ const store = useComposerDraftStore . getState ( ) ;
526+ const file = new File ( [ "raw" ] , "photo.DNG" , { type : "image/x-adobe-dng" } ) ;
527+ const marker : ComposerFileAttachment = {
528+ type : "file" ,
529+ id : "dng-marker" ,
530+ name : file . name ,
531+ mimeType : "application/octet-stream" ,
532+ sizeBytes : file . size ,
533+ file : null ,
534+ } ;
535+ store . addFiles ( threadRef , [ marker ] ) ;
536+ store . addImages (
537+ threadRef ,
538+ Array . from ( { length : PROVIDER_SEND_TURN_MAX_ATTACHMENTS - 1 } , ( _ , index ) =>
539+ makeImage ( {
540+ id : `image-${ index } ` ,
541+ name : `image-${ index } .png` ,
542+ previewUrl : `blob:image-${ index } ` ,
543+ } ) ,
544+ ) ,
545+ ) ;
546+
547+ const repicked : ComposerFileAttachment = {
548+ ...marker ,
549+ id : "dng-repicked" ,
550+ mimeType : file . type ,
551+ file,
552+ } ;
553+ store . addFiles ( threadRef , [ repicked ] ) ;
554+
555+ const files = store . getComposerDraft ( threadRef ) ?. files ;
556+ expect ( files ) . toEqual ( [ repicked ] ) ;
557+ expect ( files ?. some ( composerFileNeedsReattach ) ) . toBe ( false ) ;
558+ } ) ;
559+
524560 it ( "replaces a needs-reattach marker when the same file is picked again" , ( ) => {
525561 const store = useComposerDraftStore . getState ( ) ;
526562 const marker : ComposerFileAttachment = { ...makeFile ( "file-marker" ) , file : null } ;
0 commit comments