Skip to content

Commit e7ad038

Browse files
committed
test(modal): update modal test to add new buttons and move toast
1 parent a1e17c6 commit e7ad038

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

src/components/modal/test/basic/app-module.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ export class E2EPage {
7777
}
7878

7979
presentModalChildNav() {
80+
this.modalCtrl.create(ContactUs).present();
81+
}
82+
83+
presentToolbarModal() {
84+
this.modalCtrl.create(ToolbarModal).present();
85+
}
86+
87+
presentModalWithInputs() {
88+
let modal = this.modalCtrl.create(ModalWithInputs);
89+
modal.onDidDismiss((data: any) => {
90+
console.log('Modal with inputs data:', data);
91+
});
92+
modal.present();
93+
}
94+
95+
presentNavModalWithToast() {
8096
this.toastCtrl.create({
8197
message: 'Will present a modal with child nav...',
8298
duration: 1000,
@@ -87,7 +103,7 @@ export class E2EPage {
87103
}, 500);
88104
}
89105

90-
presentToolbarModal() {
106+
presentToolbarModalWithToast() {
91107
this.toastCtrl.create({
92108
message: 'Will present a modal with toolbars...',
93109
duration: 1000,
@@ -98,14 +114,6 @@ export class E2EPage {
98114
}, 500);
99115
}
100116

101-
presentModalWithInputs() {
102-
let modal = this.modalCtrl.create(ModalWithInputs);
103-
modal.onDidDismiss((data: any) => {
104-
console.log('Modal with inputs data:', data);
105-
});
106-
modal.present();
107-
}
108-
109117
ionViewDidLoad() {
110118
console.log('E2EPage ionViewDidLoad fired');
111119
}

src/components/modal/test/basic/e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ it('should open modal', function() {
44
});
55

66
it('should close alert with button click', function() {
7-
element(by.css('.alert-button:last-child')).click();
7+
element(by.css('.alert-button')).click();
88
});
99

1010
it('should close with close button click', function() {
@@ -16,7 +16,7 @@ it('should open toolbar modal', function() {
1616
});
1717

1818
it('should close alert with button click', function() {
19-
element(by.css('.alert-button:last-child')).click();
19+
element(by.css('.alert-button')).click();
2020
});
2121

2222
it('should close toolbar modal', function() {

src/components/modal/test/basic/main.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
<p>
2222
<button ion-button (click)="presentModalWithInputs()">Present modal w/ inputs</button>
2323
</p>
24+
<p>
25+
<button ion-button (click)="presentNavModalWithToast()">Present toast then child ion-nav modal</button>
26+
</p>
27+
<p>
28+
<button ion-button (click)="presentToolbarModalWithToast()">Present toast then toolbar modal</button>
29+
</p>
2430
<p>
2531
{{platforms | json}}
2632
</p>

0 commit comments

Comments
 (0)