File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -421,11 +421,15 @@ describe("JSONFormatter", () => {
421421 projectConfig ,
422422 createMockMeta ( )
423423 ) ;
424- const mockTextItem = createMockTextItem ( { pluralForm : "one" } ) ;
424+ const mockTextItem = createMockTextItem ( {
425+ pluralForm : "one" ,
426+ text : "The {{count}} ring to rule them all" ,
427+ } ) ;
425428 formatter . transformAPITextEntity ( mockTextItem , { } ) ;
426- expect (
427- formatter . getOutputFiles ( ) [ "project-1___base" ] . content
428- ) . toHaveProperty ( `${ mockTextItem . id } _one` ) ;
429+ const fileContent =
430+ formatter . getOutputFiles ( ) [ "project-1___base" ] . content ;
431+ expect ( fileContent ) . toHaveProperty ( `${ mockTextItem . id } _one` ) ;
432+ expect ( fileContent [ `${ mockTextItem . id } _one` ] ) . toEqual ( mockTextItem . text ) ;
429433 expect (
430434 formatter . getOutputFiles ( ) [ "project-1___base" ] . content
431435 ) . not . toHaveProperty ( mockTextItem . id ) ;
Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ export default class JSONFormatter extends applyMixins(
6161 * @param variablesById Mapping of devID <> variable data returned from API response.
6262 */
6363 private transformAPITextEntity ( textEntity : TextItem | Component , variablesById : Record < string , Variable > ) {
64- const fileName = isTextItem ( textEntity ) ? `${ textEntity . projectId } ___${ textEntity . variantId || BASE_VARIANT_ID } ` : `components___${ textEntity . variantId || BASE_VARIANT_ID } ` ;
64+ const fileName = isTextItem ( textEntity )
65+ ? `${ textEntity . projectId } ___${ textEntity . variantId || BASE_VARIANT_ID } `
66+ : `components___${ textEntity . variantId || BASE_VARIANT_ID } ` ;
6567
6668 this . outputFiles [ fileName ] ??= new JSONOutputFile ( {
6769 filename : fileName ,
You can’t perform that action at this time.
0 commit comments