'use strict'; if (window.jQuery) { describe('jQuery patch', function() { var doc = null; var divSpy = null; var spy1 = null; var spy2 = null; beforeEach(function() { divSpy = jasmine.createSpy('div.$destroy'); spy1 = jasmine.createSpy('span1.$destroy'); spy2 = jasmine.createSpy('span2.$destroy'); doc = $('
abcxyz
'); doc.find('span.first').bind('$destroy', spy1); doc.find('span.second').bind('$destroy', spy2); }); afterEach(function() { expect(divSpy).not.toHaveBeenCalled(); expect(spy1).toHaveBeenCalled(); expect(spy1.callCount).toEqual(1); expect(spy2).toHaveBeenCalled(); expect(spy2.callCount).toEqual(1); }); describe('$detach event', function() { it('should fire on detach()', function() { doc.find('span').detach(); }); it('should fire on remove()', function() { doc.find('span').remove(); }); it('should fire on replaceWith()', function() { doc.find('span').replaceWith('bla'); }); it('should fire on replaceAll()', function() { $('bla').replaceAll(doc.find('span')); }); it('should fire on empty()', function() { doc.empty(); }); it('should fire on html()', function() { doc.html('abc'); }); }); }); } cripts/netswitch.pl'>logtreecommitdiffstats
path: root/scripts/netswitch.pl
blob: 01f499ab95f165fcb9e713d5024cab7cfb4a32a1 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43