mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(virtual-scroll): remove runOutsideAngular error (#18752)
fixes #18746
This commit is contained in:
@ -128,7 +128,7 @@ export class IonVirtualScroll {
|
|||||||
@ContentChild(VirtualFooter) ftrTmp!: VirtualFooter;
|
@ContentChild(VirtualFooter) ftrTmp!: VirtualFooter;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private zone: NgZone,
|
private z: NgZone,
|
||||||
private iterableDiffers: IterableDiffers,
|
private iterableDiffers: IterableDiffers,
|
||||||
elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
) {
|
) {
|
||||||
@ -162,7 +162,7 @@ export class IonVirtualScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private nodeRender(el: HTMLElement | null, cell: Cell, index: number): HTMLElement {
|
private nodeRender(el: HTMLElement | null, cell: Cell, index: number): HTMLElement {
|
||||||
return this.zone.run(() => {
|
return this.z.run(() => {
|
||||||
let node: EmbeddedViewRef<VirtualContext>;
|
let node: EmbeddedViewRef<VirtualContext>;
|
||||||
if (!el) {
|
if (!el) {
|
||||||
node = this.itmTmp.viewContainer.createEmbeddedView(
|
node = this.itmTmp.viewContainer.createEmbeddedView(
|
||||||
|
@ -10,7 +10,7 @@ exports.config = {
|
|||||||
],
|
],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
|
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
args: [ "--headless", "--disable-gpu", "--window-size=400,1000", "--start-maximized" ]
|
args: [ "--headless", "--disable-gpu", "--window-size=400,1000", "--start-maximized" ]
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import { handleErrorMessages, setProperty, getText, waitTime } from './utils';
|
|||||||
describe('form', () => {
|
describe('form', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('change', () => {
|
describe('change', () => {
|
||||||
|
@ -8,7 +8,7 @@ describe('inputs', () => {
|
|||||||
await waitTime(30);
|
await waitTime(30);
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have default value', async () => {
|
it('should have default value', async () => {
|
||||||
|
@ -8,7 +8,7 @@ describe('modals', () => {
|
|||||||
await waitTime(30);
|
await waitTime(30);
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should open standalone modal and close', async () => {
|
it('should open standalone modal and close', async () => {
|
||||||
|
@ -4,7 +4,7 @@ import { handleErrorMessages, waitTime, testStack } from './utils';
|
|||||||
describe('navigation', () => {
|
describe('navigation', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate correctly', async () => {
|
it('should navigate correctly', async () => {
|
||||||
|
@ -4,7 +4,7 @@ import { waitTime, handleErrorMessages, goBack } from './utils';
|
|||||||
describe('nested-outlet', () => {
|
describe('nested-outlet', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate correctly', async () => {
|
it('should navigate correctly', async () => {
|
||||||
|
@ -4,7 +4,7 @@ import { handleErrorMessages, waitTime } from './utils';
|
|||||||
describe('providers', () => {
|
describe('providers', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load all providers', async () => {
|
it('should load all providers', async () => {
|
||||||
|
@ -9,7 +9,7 @@ describe('router-link params and fragments', () => {
|
|||||||
const id = 'MyPageID==';
|
const id = 'MyPageID==';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should go to a page with properly encoded values', async () => {
|
it('should go to a page with properly encoded values', async () => {
|
||||||
@ -53,7 +53,7 @@ describe('router-link', () => {
|
|||||||
await waitTime(30);
|
await waitTime(30);
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ describe('slides', () => {
|
|||||||
await waitTime(30);
|
await waitTime(30);
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should change index on slide change', async () => {
|
it('should change index on slide change', async () => {
|
||||||
|
@ -3,7 +3,7 @@ import { waitTime, testStack, handleErrorMessages } from './utils';
|
|||||||
|
|
||||||
describe('tabs', () => {
|
describe('tabs', () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
describe('entry url - /tabs', () => {
|
describe('entry url - /tabs', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@ -37,19 +37,12 @@ export interface LifeCycleCount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function handleErrorMessages() {
|
export function handleErrorMessages() {
|
||||||
browser.manage().logs().get('browser').then(function(browserLog) {
|
return browser.manage().logs().get('browser').then(function (browserLog) {
|
||||||
let severWarnings = false;
|
for (let i = 0; i <= browserLog.length - 1; i++) {
|
||||||
|
if (browserLog[i].level.name_ === 'SEVERE') {
|
||||||
for (let i; i <= browserLog.length - 1; i++) {
|
fail(browserLog[i].message);
|
||||||
if (browserLog[i].level.name === 'SEVERE') {
|
}
|
||||||
console.log('\n' + browserLog[i].level.name);
|
|
||||||
console.log('(Possibly exception) \n' + browserLog[i].message);
|
|
||||||
|
|
||||||
severWarnings = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(severWarnings).toBe(false);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ describe('view-child', () => {
|
|||||||
await waitTime(30);
|
await waitTime(30);
|
||||||
});
|
});
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
handleErrorMessages();
|
return handleErrorMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get a reference to all children', async () => {
|
it('should get a reference to all children', async () => {
|
||||||
|
18
angular/test/test-app/e2e/src/virtual-scroll.e2e-spec.ts
Normal file
18
angular/test/test-app/e2e/src/virtual-scroll.e2e-spec.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { browser, element, by } from 'protractor';
|
||||||
|
import { waitTime, handleErrorMessages } from './utils';
|
||||||
|
|
||||||
|
describe('virtual-scroll', () => {
|
||||||
|
afterEach(() => {
|
||||||
|
return handleErrorMessages();
|
||||||
|
});
|
||||||
|
beforeEach(async () => {
|
||||||
|
await browser.get('/virtual-scroll');
|
||||||
|
await waitTime(30);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open virtual-scroll', () => {
|
||||||
|
const virtualElements = element.all(by.css('ion-virtual-scroll > *'));
|
||||||
|
expect(virtualElements.count()).toBeGreaterThan(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
@ -8,6 +8,7 @@
|
|||||||
"sync": "sh scripts/sync.sh",
|
"sync": "sh scripts/sync.sh",
|
||||||
"build": "ng build --prod --no-progress",
|
"build": "ng build --prod --no-progress",
|
||||||
"test": "ng e2e --prod",
|
"test": "ng e2e --prod",
|
||||||
|
"test.dev": "npm run sync && ng e2e",
|
||||||
"lint": "ng lint"
|
"lint": "ng lint"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
|
Reference in New Issue
Block a user