forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggleView.unit.js
More file actions
30 lines (27 loc) · 873 Bytes
/
toggleView.unit.js
File metadata and controls
30 lines (27 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
describe('Toggle view', function() {
var element, toggle;
beforeEach(function() {
element = $('<div class="item item-toggle disable-pointer-events">' +
'<div>Cats</div>' +
'<label class="toggle enable-pointer-events">' +
'<input type="checkbox">' +
'<div class="track disable-pointer-events">' +
'<div class="handle"></div>' +
'</div>' +
'</label>' +
'</div>');
el = element[0].getElementsByTagName('label')[0];
checkbox = el.children[0];
track = el.children[1];
handle = track.children[0];
toggle = new ionic.views.Toggle({
el: el,
checkbox: checkbox,
track: track,
handle: handle
});
});
it('Should init', function() {
expect(toggle.el).not.toBe(undefined);
});
});