mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(modal): update modal test to add new buttons and move toast
This commit is contained in:
@@ -77,6 +77,22 @@ export class E2EPage {
|
||||
}
|
||||
|
||||
presentModalChildNav() {
|
||||
this.modalCtrl.create(ContactUs).present();
|
||||
}
|
||||
|
||||
presentToolbarModal() {
|
||||
this.modalCtrl.create(ToolbarModal).present();
|
||||
}
|
||||
|
||||
presentModalWithInputs() {
|
||||
let modal = this.modalCtrl.create(ModalWithInputs);
|
||||
modal.onDidDismiss((data: any) => {
|
||||
console.log('Modal with inputs data:', data);
|
||||
});
|
||||
modal.present();
|
||||
}
|
||||
|
||||
presentNavModalWithToast() {
|
||||
this.toastCtrl.create({
|
||||
message: 'Will present a modal with child nav...',
|
||||
duration: 1000,
|
||||
@@ -87,7 +103,7 @@ export class E2EPage {
|
||||
}, 500);
|
||||
}
|
||||
|
||||
presentToolbarModal() {
|
||||
presentToolbarModalWithToast() {
|
||||
this.toastCtrl.create({
|
||||
message: 'Will present a modal with toolbars...',
|
||||
duration: 1000,
|
||||
@@ -98,14 +114,6 @@ export class E2EPage {
|
||||
}, 500);
|
||||
}
|
||||
|
||||
presentModalWithInputs() {
|
||||
let modal = this.modalCtrl.create(ModalWithInputs);
|
||||
modal.onDidDismiss((data: any) => {
|
||||
console.log('Modal with inputs data:', data);
|
||||
});
|
||||
modal.present();
|
||||
}
|
||||
|
||||
ionViewDidLoad() {
|
||||
console.log('E2EPage ionViewDidLoad fired');
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ it('should open modal', function() {
|
||||
});
|
||||
|
||||
it('should close alert with button click', function() {
|
||||
element(by.css('.alert-button:last-child')).click();
|
||||
element(by.css('.alert-button')).click();
|
||||
});
|
||||
|
||||
it('should close with close button click', function() {
|
||||
@@ -16,7 +16,7 @@ it('should open toolbar modal', function() {
|
||||
});
|
||||
|
||||
it('should close alert with button click', function() {
|
||||
element(by.css('.alert-button:last-child')).click();
|
||||
element(by.css('.alert-button')).click();
|
||||
});
|
||||
|
||||
it('should close toolbar modal', function() {
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
<p>
|
||||
<button ion-button (click)="presentModalWithInputs()">Present modal w/ inputs</button>
|
||||
</p>
|
||||
<p>
|
||||
<button ion-button (click)="presentNavModalWithToast()">Present toast then child ion-nav modal</button>
|
||||
</p>
|
||||
<p>
|
||||
<button ion-button (click)="presentToolbarModalWithToast()">Present toast then toolbar modal</button>
|
||||
</p>
|
||||
<p>
|
||||
{{platforms | json}}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user