@@ -10,9 +10,9 @@ import type {
1010} from 'interlinearizer' ;
1111import { createAnalysisStore } from '../../store' ;
1212import { makePhraseLink } from '../test-helpers' ;
13+ import { emptyAnalysis } from '../../types/empty-factories' ;
1314import {
1415 createPhrase ,
15- defaultAnalysis ,
1616 defaultState ,
1717 deletePhrase ,
1818 mergePhrases ,
@@ -49,7 +49,7 @@ function makeApprovedLink(ta: TokenAnalysis): TokenAnalysisLink {
4949 */
5050function makeAnalysis ( ta : TokenAnalysis ) : TextAnalysis {
5151 return {
52- ...defaultAnalysis ,
52+ ...emptyAnalysis ( ) ,
5353 tokenAnalyses : [ ta ] ,
5454 tokenAnalysisLinks : [ makeApprovedLink ( ta ) ] ,
5555 } ;
@@ -67,7 +67,7 @@ describe('setAnalysis', () => {
6767
6868 it ( 'does not mutate analysisLanguage' , ( ) => {
6969 const store = createAnalysisStore ( { analysis : { ...defaultState , analysisLanguage : 'fr' } } ) ;
70- store . dispatch ( setAnalysis ( defaultAnalysis ) ) ;
70+ store . dispatch ( setAnalysis ( emptyAnalysis ( ) ) ) ;
7171 expect ( store . getState ( ) . analysis . analysisLanguage ) . toBe ( 'fr' ) ;
7272 } ) ;
7373} ) ;
@@ -82,7 +82,7 @@ describe('writeGloss', () => {
8282 } ;
8383 const store = createAnalysisStore ( {
8484 analysis : {
85- analysis : { ...defaultAnalysis , tokenAnalysisLinks : [ orphanLink ] } ,
85+ analysis : { ...emptyAnalysis ( ) , tokenAnalysisLinks : [ orphanLink ] } ,
8686 analysisLanguage : 'und' ,
8787 } ,
8888 } ) ;
@@ -102,7 +102,7 @@ describe('writeGloss', () => {
102102 } ;
103103 const store = createAnalysisStore ( {
104104 analysis : {
105- analysis : { ...defaultAnalysis , tokenAnalysisLinks : [ orphanLink ] } ,
105+ analysis : { ...emptyAnalysis ( ) , tokenAnalysisLinks : [ orphanLink ] } ,
106106 analysisLanguage : 'und' ,
107107 } ,
108108 } ) ;
@@ -159,7 +159,7 @@ describe('selectApprovedGloss', () => {
159159 */
160160function makeAnalysisWithPhrase ( link : PhraseAnalysisLink ) : TextAnalysis {
161161 return {
162- ...defaultAnalysis ,
162+ ...emptyAnalysis ( ) ,
163163 phraseAnalyses : [ { id : link . analysisId , surfaceText : 'phrase' } ] ,
164164 phraseAnalysisLinks : [ link ] ,
165165 } ;
@@ -288,7 +288,7 @@ describe('deletePhrase', () => {
288288 const store = createAnalysisStore ( {
289289 analysis : {
290290 analysis : {
291- ...defaultAnalysis ,
291+ ...emptyAnalysis ( ) ,
292292 phraseAnalyses : [
293293 { id : 'phrase-1' , surfaceText : 'A' } ,
294294 { id : 'phrase-2' , surfaceText : 'B' } ,
@@ -316,7 +316,7 @@ describe('mergePhrases', () => {
316316 const store = createAnalysisStore ( {
317317 analysis : {
318318 analysis : {
319- ...defaultAnalysis ,
319+ ...emptyAnalysis ( ) ,
320320 phraseAnalyses : [
321321 { id : 'phrase-1' , surfaceText : 'A' } ,
322322 { id : 'phrase-2' , surfaceText : 'B' } ,
@@ -377,7 +377,7 @@ describe('mergePhrases', () => {
377377 const store = createAnalysisStore ( {
378378 analysis : {
379379 analysis : {
380- ...defaultAnalysis ,
380+ ...emptyAnalysis ( ) ,
381381 phraseAnalyses : [ { id : 'phrase-1' , surfaceText : 'A' } ] ,
382382 phraseAnalysisLinks : [ phrase ] ,
383383 } ,
@@ -436,7 +436,7 @@ describe('selectPhraseLinks', () => {
436436 status : 'suggested' ,
437437 } ;
438438 const analysis : TextAnalysis = {
439- ...defaultAnalysis ,
439+ ...emptyAnalysis ( ) ,
440440 phraseAnalyses : [
441441 { id : 'phrase-1' , surfaceText : 'A' } ,
442442 { id : 'phrase-2' , surfaceText : 'B' } ,
0 commit comments