fix(angular): race condition when fast navigation (#17197)

fixes #17194
fixes #16449
fixes #15413
This commit is contained in:
Manu MA
2019-01-22 15:03:43 +01:00
committed by GitHub
parent 3defbf3a8f
commit a945b03144
11 changed files with 165 additions and 56 deletions

View File

@@ -45,7 +45,7 @@ describe('form', () => {
});
it('ion-toggle should change', async () => {
await element(by.css('ion-toggle')).click();
await element(by.css('form ion-toggle')).click();
await testData({
'datetime': '2010-08-20',
'select': null,
@@ -84,7 +84,7 @@ describe('form', () => {
});
it('ion-toggle should change only after blur', async () => {
await element(by.css('ion-toggle')).click();
await element(by.css('form ion-toggle')).click();
await testData({
'datetime': '2010-08-20',
'select': null,

View File

@@ -0,0 +1,24 @@
import { browser, element, by } from 'protractor';
import { handleErrorMessages, waitTime, testStack } from './utils';
describe('navigation', () => {
afterEach(() => {
handleErrorMessages();
});
it('should navigate correctly', async () => {
await browser.get('/navigation/page1');
await waitTime(2000);
await testStack('ion-router-outlet', ['app-navigation-page2', 'app-navigation-page1']);
const pageHidden = element(by.css('app-navigation-page2'));
expect(await pageHidden.getAttribute('aria-hidden')).toEqual('true');
expect(await pageHidden.getAttribute('class')).toEqual('ion-page ion-page-hidden');
const pageVisible = element(by.css('app-navigation-page1'));
expect(await pageVisible.getAttribute('aria-hidden')).toEqual(null);
expect(await pageVisible.getAttribute('class')).toEqual('ion-page can-go-back');
});
});