corrade-nucleus-nucleons – Blame information for rev 26
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | (function(){ |
2 | |||
3 | 'use strict'; |
||
4 | |||
5 | /**
|
||
6 | * Empty tests.
|
||
7 | *
|
||
8 | */ |
||
9 | describe('An empty HTML form', function () { |
||
10 | |||
11 | beforeEach(function () { |
||
12 | var html = '<form id="newForm"></form>'; |
||
13 | var $newForm = document.createElement('div'); |
||
14 | $newForm.id = 'fixtures'; |
||
15 | $newForm.innerHTML = html; |
||
16 | document.body.appendChild($newForm); |
||
17 | }); |
||
18 | |||
19 | afterEach(function () { |
||
20 | document.body.removeChild(document.getElementById('fixtures')); |
||
21 | }); |
||
22 | |||
23 | it('should return false if null is passed as argument', function(){ |
||
24 | expect(formToObject(null)).toBe(false); |
||
25 | }); |
||
26 | |||
27 | it('should return false if an empty string is passed as argument', function(){ |
||
28 | expect(formToObject('')).toBe(false); |
||
29 | }); |
||
30 | |||
31 | it('should return false if undefined object is passed', function(){ |
||
32 | expect(formToObject(undefined)).toBe(false); |
||
33 | }); |
||
34 | |||
35 | it('should return false if the argument passed is invalid', function(){ |
||
36 | expect(formToObject('newFormUndefined')).toBe(false); |
||
37 | }); |
||
38 | |||
39 | it('should return false if the form has no elements', function(){ |
||
40 | expect(formToObject('newForm')).toBe(false); |
||
41 | }); |
||
42 | |||
43 | }); |
||
44 | |||
45 | }); |