From 6a937765c87e0dacbfa91255a9c339090f7715a9 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:54:04 -0500 Subject: [PATCH] test: ensure i18n application E2E tests are executed --- tests/legacy-cli/e2e/tests/i18n/legacy.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/legacy-cli/e2e/tests/i18n/legacy.ts b/tests/legacy-cli/e2e/tests/i18n/legacy.ts index 7c92814c384b..aef8cc2b561a 100644 --- a/tests/legacy-cli/e2e/tests/i18n/legacy.ts +++ b/tests/legacy-cli/e2e/tests/i18n/legacy.ts @@ -25,7 +25,7 @@ export const langTranslations = [ translation: { helloPartial: 'Bonjour', hello: 'Bonjour i18n!', - plural: 'Mis à jour Il y a 3 minutes', + plural: 'Mis à jour il y a 3 minutes', date: 'janvier', }, translationReplacements: [ @@ -34,7 +34,7 @@ export const langTranslations = [ ['Updated', 'Mis à jour'], ['just now', 'juste maintenant'], ['one minute ago', 'il y a une minute'], - ['other {', 'other {Il y a'], + [/other {/g, 'other {il y a '], ['minutes ago', 'minutes'], ], }, @@ -52,7 +52,7 @@ export const langTranslations = [ ['Updated', 'Aktualisiert'], ['just now', 'gerade jetzt'], ['one minute ago', 'vor einer Minute'], - ['other {', 'other {vor'], + [/other {/g, 'other {vor '], ['minutes ago', 'Minuten'], ], }, @@ -91,12 +91,12 @@ export async function setupI18nConfig(useLocalize = true) { // Add e2e specs for each lang. for (const { lang, translation } of langTranslations) { - await writeFile(`./src/app.${lang}.e2e-spec.ts`, ` + await writeFile(`./e2e/src/app.${lang}.e2e-spec.ts`, ` import { browser, logging, element, by } from 'protractor'; describe('workspace-project App', () => { const getParagraph = (name: string) => element(by.css('app-root p#' + name)).getText(); - beforeEach(() => browser.get(browser.baseUrl);); + beforeEach(() => browser.get(browser.baseUrl)); afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); @@ -112,7 +112,7 @@ export async function setupI18nConfig(useLocalize = true) { expect(getParagraph('locale')).toEqual('${lang}')); it('should display localized date', () => - expect(getParagraph('date')).toEqual('${translation.plural}')); + expect(getParagraph('date')).toEqual('${translation.date}')); it('should display pluralized message', () => expect(getParagraph('plural')).toEqual('${translation.plural}')); @@ -190,7 +190,7 @@ export async function setupI18nConfig(useLocalize = true) { if (lang != sourceLocale) { await copyFile('src/locale/messages.xlf', `src/locale/messages.${lang}.xlf`); for (const replacements of translationReplacements) { - await replaceInFile(`src/locale/messages.${lang}.xlf`, replacements[0], replacements[1]); + await replaceInFile(`src/locale/messages.${lang}.xlf`, replacements[0], replacements[1] as string); } } }