Skip to content
Permalink
Browse files

fix(overlay): ensure lifecycles fire properly (#19579)

  • Loading branch information...
liamdebeasi committed Oct 8, 2019
1 parent 02c1724 commit a7b964279bd232ca9bb0c0f3710c6e2be5a55c11
Showing with 13 additions and 1 deletion.
  1. +12 −0 core/src/components/modal/test/test.utils.ts
  2. +1 −1 core/src/utils/overlays.ts
@@ -14,8 +14,16 @@ export const testModal = async (
});

const screenshotCompares = [];
const ionModalWillPresent = await page.spyOnEvent('ionModalWillPresent');
const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');
const ionModalWillDismiss = await page.spyOnEvent('ionModalWillDismiss');
const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss');

await page.click(selector);

await ionModalWillPresent.next();
await ionModalDidPresent.next();

await page.waitForSelector(selector);

let modal = await page.find('ion-modal');
@@ -25,6 +33,10 @@ export const testModal = async (
screenshotCompares.push(await page.compareScreenshot());

await modal.callMethod('dismiss');

await ionModalWillDismiss.next();
await ionModalDidDismiss.next();

await modal.waitForNotVisible();

screenshotCompares.push(await page.compareScreenshot('dismiss'));
@@ -221,7 +221,7 @@ const overlayAnimation = async (
/**
* TODO: Remove AnimationBuilder
*/
const hasCompleted = (typeof animationResult as any === 'boolean') ? animationResult : (animation as any).hasCompleted;
const hasCompleted = (typeof animationResult as any === 'undefined') ? true : (animation as any).hasCompleted;
if (isAnimationBuilder) {
animation.destroy();
}

0 comments on commit a7b9642

Please sign in to comment.
You can’t perform that action at this time.