Skip to content

Commit 069d1e4

Browse files
caseyg1204perrygovier
authored andcommitted
test(modal): Add unit test for modal view
1 parent eba5883 commit 069d1e4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/unit/views/modalView.unit.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
describe('Modal View', function() {
2+
var h;
3+
beforeEach(function() {
4+
m = document.createElement('modal');
5+
m.innerHTML = '<a class="button">Click</a><h1 class="title">What what what</h1>';
6+
});
7+
8+
it('Should init', function() {
9+
var mod = new ionic.views.Modal({
10+
el: m
11+
});
12+
expect(mod.focusFirstInput).toBe(false);
13+
expect(mod.unfocusOnHide).toBe(true);
14+
expect(mod.focusFirstDelay).toBe(600);
15+
expect(mod.backdropClickToClose).toBe(true);
16+
expect(mod.hardwareBackButtonClose).toBe(true);
17+
18+
});
19+
});

0 commit comments

Comments
 (0)