test(alert): add alert checkbox and fast close tests

This commit is contained in:
Adam Bradley
2016-01-20 11:59:36 -06:00
parent ee106377fc
commit eeb0417d02
2 changed files with 73 additions and 0 deletions

View File

@ -148,6 +148,75 @@ class E2EPage {
});
}
doCheckbox() {
let alert = Alert.create();
alert.setTitle('Checkbox!');
alert.addInput({
type: 'checkbox',
label: 'Checkbox 1',
value: 'value1',
checked: true
});
alert.addInput({
type: 'checkbox',
label: 'Checkbox 2',
value: 'value2'
});
alert.addInput({
type: 'checkbox',
label: 'Checkbox 3',
value: 'value3'
});
alert.addInput({
type: 'checkbox',
label: 'Checkbox 4',
value: 'value4'
});
alert.addInput({
type: 'checkbox',
label: 'Checkbox 5',
value: 'value5'
});
alert.addInput({
type: 'checkbox',
label: 'Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6 Checkbox 6',
value: 'value6'
});
alert.addButton('Cancel');
alert.addButton({
text: 'Ok',
handler: data => {
console.log('Checkbox data:', data);
this.testCheckboxOpen = false;
this.testCheckboxResult = data;
}
});
this.nav.present(alert).then(() => {
this.testCheckboxOpen = true;
});
}
doFastClose() {
let alert = Alert.create({
title: 'Alert!',
buttons: ['OK']
});
this.nav.present(alert);
setTimeout(() => {
alert.dismiss();
}, 100);
}
}

View File

@ -9,6 +9,8 @@
<button block class="e2eOpenConfirm" (click)="doConfirm()">Confirm</button>
<button block class="e2eOpenPrompt" (click)="doPrompt()">Prompt</button>
<button block class="e2eOpenRadio" (click)="doRadio()">Radio</button>
<button block class="e2eOpenCheckbox" (click)="doCheckbox()">Checkbox</button>
<button block class="e2eFastClose" (click)="doFastClose()">Fast Close</button>
<pre>
Confirm Opened: {{testConfirmOpen}}
@ -17,6 +19,8 @@
Prompt Result: {{testPromptResult | json}}
Radio Opened: {{testRadioOpen}}
Radio Result: {{testRadioResult}}
Checkbox Opened: {{testCheckboxOpen}}
Checkbox Result: {{testCheckboxResult}}
</pre>
</ion-content>