mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
test(modal): fix tests
This commit is contained in:
@ -46,7 +46,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<h1>Content of doom</h1>
|
<h1>Content of doom</h1>
|
||||||
<div>Here's some more content</div>
|
<div>Here's some more content</div>
|
||||||
<ion-button>Dismiss Modal</ion-button>
|
<ion-button class="dismiss">Dismiss Modal</ion-button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -42,14 +42,14 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<h1>Content of doom</h1>
|
<h1>Content of doom</h1>
|
||||||
<div>Here's some more content</div>
|
<div>Here's some more content</div>
|
||||||
<ion-button>Dismiss Modal</ion-button>
|
<ion-button class="dismiss">Dismiss Modal</ion-button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-page>`;
|
</ion-page>`;
|
||||||
|
|
||||||
// listen for close event
|
// listen for close event
|
||||||
const button = this.querySelector('ion-button');
|
const button = this.querySelector('ion-button');
|
||||||
button.addEventListener('click', async () => {
|
button.addEventListener('click', async () => {
|
||||||
await this.querySelector('ion-modal-controller').dismiss();
|
await document.querySelector('ion-modal-controller').dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user