refactor(docs-infra): fix docs examples for tslint rule only-arrow-functions (#38143)

This commit updates the docs examples to be compatible with the
`only-arrow-functions` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
This commit is contained in:
George Kalpakas
2020-07-30 13:03:13 +03:00
committed by Michael Prentice
parent fa82a82a07
commit d89ab70036
64 changed files with 486 additions and 504 deletions

View File

@ -2,35 +2,35 @@ import { browser, element, by } from 'protractor';
describe('i18n E2E Tests', () => {
beforeEach(function () {
beforeEach(() => {
browser.get('');
});
it('should display i18n translated welcome: Bonjour !', function () {
it('should display i18n translated welcome: Bonjour !', () => {
expect(element(by.css('h1')).getText()).toEqual('Bonjour i18n !');
});
it('should display the node texts without elements', function () {
it('should display the node texts without elements', () => {
expect(element(by.css('app-root')).getText()).toContain(`Je n'affiche aucun élément`);
});
it('should display the translated title attribute', function () {
it('should display the translated title attribute', () => {
const title = element(by.css('img')).getAttribute('title');
expect(title).toBe(`Logo d'Angular`);
});
it('should display the ICU plural expression', function () {
it('should display the ICU plural expression', () => {
expect(element.all(by.css('span')).get(0).getText()).toBe(`Mis à jour à l'instant`);
});
it('should display the ICU select expression', function () {
it('should display the ICU select expression', () => {
const selectIcuExp = element.all(by.css('span')).get(1);
expect(selectIcuExp.getText()).toBe(`L'auteur est une femme`);
element.all(by.css('button')).get(2).click();
expect(selectIcuExp.getText()).toBe(`L'auteur est un homme`);
});
it('should display the nested expression', function() {
it('should display the nested expression', () => {
const nestedExp = element.all(by.css('span')).get(2);
const incBtn = element.all(by.css('button')).get(0);
expect(nestedExp.getText()).toBe(`Mis à jour: à l'instant`);