Skip to content

Commit 6a93776

Browse files
committed
test: ensure i18n application E2E tests are executed
1 parent b200e13 commit 6a93776

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/legacy-cli/e2e/tests/i18n/legacy.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const langTranslations = [
2525
translation: {
2626
helloPartial: 'Bonjour',
2727
hello: 'Bonjour i18n!',
28-
plural: 'Mis à jour Il y a 3 minutes',
28+
plural: 'Mis à jour il y a 3 minutes',
2929
date: 'janvier',
3030
},
3131
translationReplacements: [
@@ -34,7 +34,7 @@ export const langTranslations = [
3434
['Updated', 'Mis à jour'],
3535
['just now', 'juste maintenant'],
3636
['one minute ago', 'il y a une minute'],
37-
['other {', 'other {Il y a'],
37+
[/other {/g, 'other {il y a '],
3838
['minutes ago', 'minutes'],
3939
],
4040
},
@@ -52,7 +52,7 @@ export const langTranslations = [
5252
['Updated', 'Aktualisiert'],
5353
['just now', 'gerade jetzt'],
5454
['one minute ago', 'vor einer Minute'],
55-
['other {', 'other {vor'],
55+
[/other {/g, 'other {vor '],
5656
['minutes ago', 'Minuten'],
5757
],
5858
},
@@ -91,12 +91,12 @@ export async function setupI18nConfig(useLocalize = true) {
9191

9292
// Add e2e specs for each lang.
9393
for (const { lang, translation } of langTranslations) {
94-
await writeFile(`./src/app.${lang}.e2e-spec.ts`, `
94+
await writeFile(`./e2e/src/app.${lang}.e2e-spec.ts`, `
9595
import { browser, logging, element, by } from 'protractor';
9696
9797
describe('workspace-project App', () => {
9898
const getParagraph = (name: string) => element(by.css('app-root p#' + name)).getText();
99-
beforeEach(() => browser.get(browser.baseUrl););
99+
beforeEach(() => browser.get(browser.baseUrl));
100100
afterEach(async () => {
101101
// Assert that there are no errors emitted from the browser
102102
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
@@ -112,7 +112,7 @@ export async function setupI18nConfig(useLocalize = true) {
112112
expect(getParagraph('locale')).toEqual('${lang}'));
113113
114114
it('should display localized date', () =>
115-
expect(getParagraph('date')).toEqual('${translation.plural}'));
115+
expect(getParagraph('date')).toEqual('${translation.date}'));
116116
117117
it('should display pluralized message', () =>
118118
expect(getParagraph('plural')).toEqual('${translation.plural}'));
@@ -190,7 +190,7 @@ export async function setupI18nConfig(useLocalize = true) {
190190
if (lang != sourceLocale) {
191191
await copyFile('src/locale/messages.xlf', `src/locale/messages.${lang}.xlf`);
192192
for (const replacements of translationReplacements) {
193-
await replaceInFile(`src/locale/messages.${lang}.xlf`, replacements[0], replacements[1]);
193+
await replaceInFile(`src/locale/messages.${lang}.xlf`, replacements[0], replacements[1] as string);
194194
}
195195
}
196196
}

0 commit comments

Comments
 (0)