@@ -20,7 +20,7 @@ import {
2020 * Builds a minimal `TextAnalysis` with a single approved `TokenAnalysis` for the given token.
2121 *
2222 * @param tokenRef - Token reference string.
23- * @param gloss - Gloss value for the `'en '` language key.
23+ * @param gloss - Gloss value for the `'und '` language key.
2424 * @param surfaceText - Surface text of the token.
2525 * @returns A `TextAnalysis` seeded with one approved token analysis.
2626 */
@@ -32,7 +32,7 @@ function makeAnalysisWithGloss(
3232 const ta : TokenAnalysis = {
3333 id : `${ tokenRef } -analysis` ,
3434 surfaceText,
35- gloss : { en : gloss } ,
35+ gloss : { und : gloss } ,
3636 } ;
3737 const link : TokenAnalysisLink = {
3838 analysisId : ta . id ,
@@ -109,7 +109,7 @@ function GlossWriter({
109109describe ( 'useGloss' , ( ) => {
110110 it ( 'returns an empty string for an unknown token' , ( ) => {
111111 render (
112- < AnalysisStoreProvider >
112+ < AnalysisStoreProvider analysisLanguage = "und" >
113113 < GlossReader tokenRef = "tok-1" />
114114 </ AnalysisStoreProvider > ,
115115 ) ;
@@ -118,7 +118,10 @@ describe('useGloss', () => {
118118
119119 it ( 'returns the approved gloss from initialAnalysis' , ( ) => {
120120 render (
121- < AnalysisStoreProvider initialAnalysis = { makeAnalysisWithGloss ( 'tok-1' , 'hello' ) } >
121+ < AnalysisStoreProvider
122+ initialAnalysis = { makeAnalysisWithGloss ( 'tok-1' , 'hello' ) }
123+ analysisLanguage = "und"
124+ >
122125 < GlossReader tokenRef = "tok-1" />
123126 </ AnalysisStoreProvider > ,
124127 ) ;
@@ -141,7 +144,7 @@ describe('useGloss', () => {
141144 phraseAnalysisLinks : [ ] ,
142145 } ;
143146 render (
144- < AnalysisStoreProvider initialAnalysis = { analysis } >
147+ < AnalysisStoreProvider initialAnalysis = { analysis } analysisLanguage = "und" >
145148 < GlossReader tokenRef = "tok-1" />
146149 </ AnalysisStoreProvider > ,
147150 ) ;
@@ -150,7 +153,7 @@ describe('useGloss', () => {
150153
151154 it ( 'updates when the subscribed token is glossed via dispatch' , async ( ) => {
152155 render (
153- < AnalysisStoreProvider >
156+ < AnalysisStoreProvider analysisLanguage = "und" >
154157 < GlossReader tokenRef = "tok-1" />
155158 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "world" />
156159 </ AnalysisStoreProvider > ,
@@ -170,7 +173,7 @@ describe('useGloss', () => {
170173 }
171174
172175 render (
173- < AnalysisStoreProvider >
176+ < AnalysisStoreProvider analysisLanguage = "und" >
174177 < CountingGlossReader tokenRef = "tok-1" />
175178 < GlossWriter tokenRef = "tok-2" surfaceText = "other" value = "other" />
176179 </ AnalysisStoreProvider > ,
@@ -214,7 +217,7 @@ describe('useGloss', () => {
214217describe ( 'useAnalysis' , ( ) => {
215218 it ( 'returns an empty analysis when no initialAnalysis is provided' , ( ) => {
216219 render (
217- < AnalysisStoreProvider >
220+ < AnalysisStoreProvider analysisLanguage = "und" >
218221 < AnalysisReader />
219222 </ AnalysisStoreProvider > ,
220223 ) ;
@@ -226,7 +229,7 @@ describe('useAnalysis', () => {
226229 it ( 'returns seeded analyses from initialAnalysis' , ( ) => {
227230 const seed = makeAnalysisWithGloss ( 'tok-1' , 'hi' ) ;
228231 render (
229- < AnalysisStoreProvider initialAnalysis = { seed } >
232+ < AnalysisStoreProvider initialAnalysis = { seed } analysisLanguage = "und" >
230233 < AnalysisReader />
231234 </ AnalysisStoreProvider > ,
232235 ) ;
@@ -237,15 +240,15 @@ describe('useAnalysis', () => {
237240
238241 it ( 'updates after a gloss write' , async ( ) => {
239242 render (
240- < AnalysisStoreProvider >
243+ < AnalysisStoreProvider analysisLanguage = "und" >
241244 < AnalysisReader />
242245 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "world" />
243246 </ AnalysisStoreProvider > ,
244247 ) ;
245248 await userEvent . click ( screen . getByRole ( 'button' , { name : 'write' } ) ) ;
246249 const analysis : TextAnalysis = JSON . parse ( screen . getByTestId ( 'analysis' ) . textContent ?? '' ) ;
247250 expect ( analysis . tokenAnalyses ) . toHaveLength ( 1 ) ;
248- expect ( analysis . tokenAnalyses [ 0 ] . gloss ) . toStrictEqual ( { en : 'world' } ) ;
251+ expect ( analysis . tokenAnalyses [ 0 ] . gloss ) . toStrictEqual ( { und : 'world' } ) ;
249252 expect ( analysis . tokenAnalysisLinks [ 0 ] . status ) . toBe ( 'approved' ) ;
250253 } ) ;
251254
@@ -260,7 +263,7 @@ describe('useAnalysis', () => {
260263describe ( 'useGlossDispatch' , ( ) => {
261264 it ( 'creates a new approved TokenAnalysis on each write' , async ( ) => {
262265 render (
263- < AnalysisStoreProvider >
266+ < AnalysisStoreProvider analysisLanguage = "und" >
264267 < AnalysisReader />
265268 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "hi" />
266269 </ AnalysisStoreProvider > ,
@@ -293,7 +296,7 @@ describe('useGlossDispatch', () => {
293296 phraseAnalysisLinks : [ ] ,
294297 } ;
295298 render (
296- < AnalysisStoreProvider initialAnalysis = { seed } >
299+ < AnalysisStoreProvider initialAnalysis = { seed } analysisLanguage = "und" >
297300 < AnalysisReader />
298301 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "new" />
299302 </ AnalysisStoreProvider > ,
@@ -310,7 +313,7 @@ describe('useGlossDispatch', () => {
310313 it ( 'calls the onGlossChange spy with tokenRef and value' , async ( ) => {
311314 const spy = jest . fn ( ) ;
312315 render (
313- < AnalysisStoreProvider onGlossChange = { spy } >
316+ < AnalysisStoreProvider analysisLanguage = "und" onGlossChange = { spy } >
314317 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "hi" />
315318 </ AnalysisStoreProvider > ,
316319 ) ;
@@ -322,14 +325,14 @@ describe('useGlossDispatch', () => {
322325 it ( 'calls onSave with the updated TextAnalysis' , async ( ) => {
323326 const onSave = jest . fn ( ) ;
324327 render (
325- < AnalysisStoreProvider onSave = { onSave } >
328+ < AnalysisStoreProvider analysisLanguage = "und" onSave = { onSave } >
326329 < GlossWriter tokenRef = "tok-1" surfaceText = "word" value = "hi" />
327330 </ AnalysisStoreProvider > ,
328331 ) ;
329332 await userEvent . click ( screen . getByRole ( 'button' , { name : 'write' } ) ) ;
330333 expect ( onSave ) . toHaveBeenCalledTimes ( 1 ) ;
331334 const saved : TextAnalysis = onSave . mock . calls [ 0 ] [ 0 ] ;
332- expect ( saved . tokenAnalyses [ 0 ] . gloss ) . toStrictEqual ( { en : 'hi' } ) ;
335+ expect ( saved . tokenAnalyses [ 0 ] . gloss ) . toStrictEqual ( { und : 'hi' } ) ;
333336 } ) ;
334337
335338 it ( 'throws when called outside an AnalysisStoreProvider' , ( ) => {
0 commit comments