From 32e315755bc0504b2b6443d263cd47901761c030 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 2 Oct 2019 18:17:56 +0100 Subject: [PATCH] test(ivy): add runtime translations to integration test app (#32867) PR Close #32867 --- .../e2e/src/app.e2e-spec.ts | 15 ++++++++----- .../e2e/src/app.po.ts | 14 ++++-------- .../src/app/app.component.html | 6 +++-- .../src/app/app.component.spec.ts | 17 +++++++------- .../src/app/app.component.ts | 12 +++++----- .../src/app/app.module.ts | 22 ++++++++----------- .../cli-hello-world-ivy-i18n/src/polyfills.ts | 11 ++++++++++ 7 files changed, 51 insertions(+), 46 deletions(-) diff --git a/integration/cli-hello-world-ivy-i18n/e2e/src/app.e2e-spec.ts b/integration/cli-hello-world-ivy-i18n/e2e/src/app.e2e-spec.ts index 29e27e6edb..7abacd1d94 100644 --- a/integration/cli-hello-world-ivy-i18n/e2e/src/app.e2e-spec.ts +++ b/integration/cli-hello-world-ivy-i18n/e2e/src/app.e2e-spec.ts @@ -1,19 +1,22 @@ -import { AppPage } from './app.po'; +import {AppPage} from './app.po'; describe('cli-hello-world-ivy App', () => { let page: AppPage; - beforeEach(() => { - page = new AppPage(); + beforeEach(() => { page = new AppPage(); }); + + it('should display title', () => { + page.navigateTo(); + expect(page.getHeading()).toEqual('Bonjour cli-hello-world-ivy-compat!'); }); it('should display welcome message', () => { page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to cli-hello-world-ivy-compat!'); + expect(page.getParagraph('message')).toEqual('Bienvenue sur l\'application i18n.'); }); it('the percent pipe should work', () => { page.navigateTo(); - expect(page.getPipeContent()).toEqual('100 % awesome'); - }) + expect(page.getParagraph('pipe')).toEqual('100 % awesome'); + }); }); diff --git a/integration/cli-hello-world-ivy-i18n/e2e/src/app.po.ts b/integration/cli-hello-world-ivy-i18n/e2e/src/app.po.ts index ae3d5f7f15..d7375c9072 100644 --- a/integration/cli-hello-world-ivy-i18n/e2e/src/app.po.ts +++ b/integration/cli-hello-world-ivy-i18n/e2e/src/app.po.ts @@ -1,15 +1,9 @@ -import { browser, by, element } from 'protractor'; +import {browser, by, element} from 'protractor'; export class AppPage { - navigateTo() { - return browser.get('/'); - } + navigateTo() { return browser.get('/'); } - getParagraphText() { - return element(by.css('app-root h1')).getText(); - } + getHeading() { return element(by.css('app-root h1')).getText(); } - getPipeContent() { - return element(by.css('app-root p')).getText(); - } + getParagraph(name: string) { return element(by.css('app-root p#' + name)).getText(); } } diff --git a/integration/cli-hello-world-ivy-i18n/src/app/app.component.html b/integration/cli-hello-world-ivy-i18n/src/app/app.component.html index 9cc50c0b62..e91a085d47 100644 --- a/integration/cli-hello-world-ivy-i18n/src/app/app.component.html +++ b/integration/cli-hello-world-ivy-i18n/src/app/app.component.html @@ -1,11 +1,13 @@

- Welcome to {{ title }}! + Hello {{ title }}!

+ +

{{ message }}

Angular Logo
-

{{ 1 | percent }} awesome

+

{{ 1 | percent }} awesome

Here are some links to help you start: