Skip to content

Commit 05d2a72

Browse files
committed
Fix failing tests
1 parent 82bcd69 commit 05d2a72

File tree

4 files changed

+27
-28
lines changed

4 files changed

+27
-28
lines changed

app/scripts/translatte/commands/applyMigrations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ testWithTmpDir('test applyMigrations with no data in server', async ({ tmpdir })
5353
join(tmpdir, 'strings', 'before.json'),
5454
join(tmpdir, 'strings', 'after.json'),
5555
'migrations',
56-
['np'],
56+
['fr'],
5757
undefined,
5858
false,
5959
);
@@ -90,7 +90,7 @@ testWithTmpDir('test applyMigrations with data in server', async ({ tmpdir }) =>
9090
join(tmpdir, 'strings', 'before.json'),
9191
join(tmpdir, 'strings', 'after.json'),
9292
'migrations',
93-
['np'],
93+
['fr'],
9494
undefined,
9595
false,
9696
);

app/scripts/translatte/commands/applyMigrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async function applyMigrations(
152152
const outputSourceFileContent: SourceFileContent = {
153153
last_migration: basename(lastMigration.file),
154154
strings: apply(
155-
sourceFile.content.filter(
155+
sourceFile.content.strings.filter(
156156
({ page_name }) => isDefined(page_name),
157157
),
158158
mergedMigrationActions,

app/scripts/translatte/mockData.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const strings1: SourceFileContent = {
243243
hash: 'c1e1b9ea3f9cfc3eb3e7b8804139ed00',
244244
key: 'emailLabel',
245245
page_name: 'login',
246-
language: 'np',
246+
language: 'fr',
247247
value: '',
248248
},
249249
{
@@ -256,7 +256,7 @@ export const strings1: SourceFileContent = {
256256
{
257257
hash: '7257816a20f2dda660c44809235ea44a',
258258
key: 'emailPlaceholder',
259-
language: 'np',
259+
language: 'fr',
260260
page_name: 'login',
261261
value: '',
262262
},
@@ -271,7 +271,7 @@ export const strings1: SourceFileContent = {
271271
hash: 'd7d3cc6191dfa630aaa8bcf8d83d8a71',
272272
key: 'header',
273273
page_name: 'login',
274-
language: 'np',
274+
language: 'fr',
275275
value: '',
276276
},
277277
{
@@ -285,7 +285,7 @@ export const strings1: SourceFileContent = {
285285
hash: '99dea78007133396a7b8ed70578ac6ae',
286286
key: 'loginButton',
287287
page_name: 'login',
288-
language: 'np',
288+
language: 'fr',
289289
value: '',
290290
},
291291
{
@@ -299,7 +299,7 @@ export const strings1: SourceFileContent = {
299299
hash: 'dc647eb65e6711e155375218212b3964',
300300
key: 'passwordLabel',
301301
page_name: 'login',
302-
language: 'np',
302+
language: 'fr',
303303
value: '',
304304
},
305305
{
@@ -313,7 +313,7 @@ export const strings1: SourceFileContent = {
313313
hash: '887f7db126221fe60d18c895d41dc8f6',
314314
key: 'confirmPasswordLabel',
315315
page_name: 'register',
316-
language: 'np',
316+
language: 'fr',
317317
value: '',
318318
},
319319
{
@@ -327,7 +327,7 @@ export const strings1: SourceFileContent = {
327327
hash: 'ce8ae9da5b7cd6c3df2929543a9af92d',
328328
key: 'emailLabel',
329329
page_name: 'register',
330-
language: 'np',
330+
language: 'fr',
331331
value: '',
332332
},
333333
{
@@ -341,7 +341,7 @@ export const strings1: SourceFileContent = {
341341
hash: 'bc910f8bdf70f29374f496f05be0330c',
342342
key: 'firstNameLabel',
343343
page_name: 'register',
344-
language: 'np',
344+
language: 'fr',
345345
value: '',
346346
},
347347
{
@@ -355,7 +355,7 @@ export const strings1: SourceFileContent = {
355355
hash: '77587239bf4c54ea493c7033e1dbf636',
356356
key: 'lastNameLabel',
357357
page_name: 'register',
358-
language: 'np',
358+
language: 'fr',
359359
value: '',
360360
},
361361
{
@@ -369,7 +369,7 @@ export const strings1: SourceFileContent = {
369369
hash: 'dc647eb65e6711e155375218212b3964',
370370
key: 'passwordLabel',
371371
page_name: 'register',
372-
language: 'np',
372+
language: 'fr',
373373
value: '',
374374
},
375375
{
@@ -383,7 +383,7 @@ export const strings1: SourceFileContent = {
383383
hash: '0ba7583639a274c434bbe6ef797115a4',
384384
key: 'registerButton',
385385
page_name: 'register',
386-
language: 'np',
386+
language: 'fr',
387387
value: '',
388388
},
389389
],
@@ -507,7 +507,7 @@ export const strings2: SourceFileContent = {
507507
hash: 'c1e1b9ea3f9cfc3eb3e7b8804139ed00',
508508
key: 'emailLabel',
509509
page_name: 'login',
510-
language: 'np',
510+
language: 'fr',
511511
value: '',
512512
},
513513
{
@@ -520,7 +520,7 @@ export const strings2: SourceFileContent = {
520520
{
521521
hash: '7257816a20f2dda660c44809235ea44a',
522522
key: 'emailPlaceholder',
523-
language: 'np',
523+
language: 'fr',
524524
page_name: 'login',
525525
value: '',
526526
},
@@ -535,7 +535,7 @@ export const strings2: SourceFileContent = {
535535
hash: 'bc910f8bdf70f29374f496f05be0330c',
536536
key: 'firstNameLabel',
537537
page_name: 'login',
538-
language: 'np',
538+
language: 'fr',
539539
value: '',
540540
},
541541
{
@@ -549,7 +549,7 @@ export const strings2: SourceFileContent = {
549549
hash: '1efc109bdddbb6e51e9b69cc0a1b0701',
550550
key: 'footer',
551551
page_name: 'login',
552-
language: 'np',
552+
language: 'fr',
553553
value: '',
554554
},
555555
{
@@ -563,7 +563,7 @@ export const strings2: SourceFileContent = {
563563
hash: '77587239bf4c54ea493c7033e1dbf636',
564564
key: 'lastNameLabel',
565565
page_name: 'login',
566-
language: 'np',
566+
language: 'fr',
567567
value: '',
568568
},
569569
{
@@ -577,7 +577,7 @@ export const strings2: SourceFileContent = {
577577
hash: '99dea78007133396a7b8ed70578ac6ae',
578578
key: 'loginBtn',
579579
page_name: 'login',
580-
language: 'np',
580+
language: 'fr',
581581
value: '',
582582
},
583583
{
@@ -591,7 +591,7 @@ export const strings2: SourceFileContent = {
591591
hash: 'dc647eb65e6711e155375218212b3964',
592592
key: 'passwordLabel',
593593
page_name: 'login',
594-
language: 'np',
594+
language: 'fr',
595595
value: '',
596596
},
597597
{
@@ -605,7 +605,7 @@ export const strings2: SourceFileContent = {
605605
hash: '463e58c1d35fb5a4a8d717c99a60d257',
606606
key: 'backLink',
607607
page_name: 'register',
608-
language: 'np',
608+
language: 'fr',
609609
value: '',
610610
},
611611
{
@@ -619,7 +619,7 @@ export const strings2: SourceFileContent = {
619619
hash: 'ce8ae9da5b7cd6c3df2929543a9af92d',
620620
key: 'emailLabel',
621621
page_name: 'register',
622-
language: 'np',
622+
language: 'fr',
623623
value: '',
624624
},
625625
{
@@ -633,7 +633,7 @@ export const strings2: SourceFileContent = {
633633
hash: 'dc647eb65e6711e155375218212b3964',
634634
key: 'passwordLabel',
635635
page_name: 'register',
636-
language: 'np',
636+
language: 'fr',
637637
value: '',
638638
},
639639
{
@@ -647,7 +647,7 @@ export const strings2: SourceFileContent = {
647647
hash: '0ba7583639a274c434bbe6ef797115a4',
648648
key: 'registerBtn',
649649
page_name: 'register',
650-
language: 'np',
650+
language: 'fr',
651651
value: '',
652652
},
653653
],

app/scripts/translatte/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import {
1616
TranslationFileContent,
1717
MigrationFileContent,
18-
// SourceFileContent,
18+
SourceFileContent,
1919
Language,
2020
ServerActionItem,
2121
SourceStringItem,
@@ -326,8 +326,7 @@ export async function readSource(fileName: string) {
326326
return fileContents[0] as {
327327
file: string,
328328
// TODO: update test for this change
329-
// content: SourceFileContent
330-
content: SourceStringItem[],
329+
content: SourceFileContent
331330
};
332331
}
333332

0 commit comments

Comments
 (0)