mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(modal): Add unit test for modal view
This commit is contained in:
committed by
Perry Govier
parent
eba588337c
commit
069d1e4b5c
19
test/unit/views/modalView.unit.js
Normal file
19
test/unit/views/modalView.unit.js
Normal file
@@ -0,0 +1,19 @@
|
||||
describe('Modal View', function() {
|
||||
var h;
|
||||
beforeEach(function() {
|
||||
m = document.createElement('modal');
|
||||
m.innerHTML = '<a class="button">Click</a><h1 class="title">What what what</h1>';
|
||||
});
|
||||
|
||||
it('Should init', function() {
|
||||
var mod = new ionic.views.Modal({
|
||||
el: m
|
||||
});
|
||||
expect(mod.focusFirstInput).toBe(false);
|
||||
expect(mod.unfocusOnHide).toBe(true);
|
||||
expect(mod.focusFirstDelay).toBe(600);
|
||||
expect(mod.backdropClickToClose).toBe(true);
|
||||
expect(mod.hardwareBackButtonClose).toBe(true);
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user