@@ -135,10 +135,10 @@ describe("resolveTranscriptCommit", () => {
135135 } ) ;
136136
137137 it ( "adds word spacing for other space-delimited languages" , ( ) => {
138- const atEnd = draft ( { text : "Schön " , selection : { start : 5 , end : 5 } } ) ;
139- expect ( resolveTranscriptCommit ( atEnd , atEnd , "Grüße " , "de-DE " ) ) . toMatchObject ( {
138+ const atStart = draft ( { text : "Änderungen " , selection : { start : 0 , end : 0 } } ) ;
139+ expect ( resolveTranscriptCommit ( atStart , atStart , "Weitere " , "de_DE " ) ) . toMatchObject ( {
140140 kind : "commit" ,
141- text : "Schön Grüße " ,
141+ text : "Weitere Änderungen " ,
142142 } ) ;
143143
144144 const combiningMark = draft ( { text : "नमस्ते" , selection : { start : 6 , end : 6 } } ) ;
@@ -148,13 +148,20 @@ describe("resolveTranscriptCommit", () => {
148148 } ) ;
149149 } ) ;
150150
151- it ( "does not add English boundary spaces to CJK or selected inline text" , ( ) => {
152- const cjk = draft ( { text : "修正キャッシュ" , selection : { start : 8 , end : 8 } } ) ;
151+ it ( "preserves spaceless languages and selected inline text" , ( ) => {
152+ const text = "修正キャッシュ" ;
153+ const cjk = draft ( { text, selection : { start : text . length , end : text . length } } ) ;
153154 expect ( resolveTranscriptCommit ( cjk , cjk , "テストも" , "ja-JP" ) ) . toMatchObject ( {
154155 kind : "commit" ,
155156 text : "修正キャッシュテストも" ,
156157 } ) ;
157158
159+ const thai = draft ( { text : "โลก" , selection : { start : 0 , end : 0 } } ) ;
160+ expect ( resolveTranscriptCommit ( thai , thai , "สวัสดี" , "th-TH" ) ) . toMatchObject ( {
161+ kind : "commit" ,
162+ text : "สวัสดีโลก" ,
163+ } ) ;
164+
158165 const selected = draft ( { text : "one $skill two" , selection : { start : 4 , end : 10 } } ) ;
159166 expect ( resolveTranscriptCommit ( selected , selected , "new" , "en-US" ) ) . toMatchObject ( {
160167 kind : "commit" ,
0 commit comments