mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
5303773daf
This commit updates the docs examples to be compatible with the `prefer-const` 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
34 lines
854 B
TypeScript
34 lines
854 B
TypeScript
import { browser, element, by, ElementFinder } from 'protractor';
|
|
|
|
describe('Testing Example', () => {
|
|
const expectedViewNames = ['Dashboard', 'Heroes', 'About'];
|
|
|
|
beforeAll(() => browser.get(''));
|
|
|
|
function getPageElts() {
|
|
const navElts = element.all(by.css('app-root nav a'));
|
|
|
|
return {
|
|
navElts,
|
|
|
|
appDashboard: element(by.css('app-root app-dashboard')),
|
|
};
|
|
}
|
|
|
|
it('has title', async () => {
|
|
expect(await browser.getTitle()).toEqual('App Under Test');
|
|
});
|
|
|
|
it(`has views ${expectedViewNames}`, async () => {
|
|
const viewNames = getPageElts().navElts.map(async (el: ElementFinder) => await el.getText());
|
|
|
|
expect(viewNames).toEqual(expectedViewNames);
|
|
});
|
|
|
|
it('has dashboard as the active view', () => {
|
|
const page = getPageElts();
|
|
|
|
expect(page.appDashboard.isPresent()).toBeTruthy();
|
|
});
|
|
});
|