chore: router move-only

This commit is contained in:
Miško Hevery
2016-05-02 17:11:21 +00:00
committed by Igor Minar
parent 072446aed3
commit d930ad1816
116 changed files with 1345 additions and 1374 deletions

View File

@ -0,0 +1,36 @@
import {verifyNoBrowserErrors, browser} from '@angular/platform-browser/testing_e2e';
import {expect} from '@angular/core/testing';
function waitForElement(selector: string) {
var EC = (<any>protractor).ExpectedConditions;
// Waits for the element with id 'abc' to be present on the dom.
browser.wait(EC.presenceOf($(selector)), 20000);
}
describe('reuse example app', function() {
afterEach(verifyNoBrowserErrors);
var URL = '@angular/examples/router/ts/reuse/';
it('should build a link which points to the detail page', function() {
browser.get(URL);
waitForElement('my-cmp');
element(by.css('#naomi-link')).click();
waitForElement('my-cmp');
expect(browser.getCurrentUrl()).toMatch(/\/naomi$/);
// type something into input
element(by.css('#message')).sendKeys('long time no see!');
// navigate to Brad
element(by.css('#brad-link')).click();
waitForElement('my-cmp');
expect(browser.getCurrentUrl()).toMatch(/\/brad$/);
// check that typed input is the same
expect(element(by.css('#message')).getAttribute('value')).toEqual('long time no see!');
});
});