8b6b1ebe by David Han Sze Chuen

- create new radio box input to test the checked/unchecked routines

- add the test DOM elements to the page because I believe dom manipulations behave more accurately in browsers
1 parent adcc0a15
1 describe('Routines', function() { 1 describe('Routines', function() {
2 var el, input; 2 var el, input, radioBox;
3 3
4 beforeEach(function() { 4 beforeEach(function() {
5 rivets.configure({ 5 rivets.configure({
...@@ -12,8 +12,23 @@ describe('Routines', function() { ...@@ -12,8 +12,23 @@ describe('Routines', function() {
12 }); 12 });
13 13
14 el = document.createElement('div'); 14 el = document.createElement('div');
15 document.body.appendChild(el);
16
15 input = document.createElement('input'); 17 input = document.createElement('input');
16 input.setAttribute('type', 'text'); 18 input.setAttribute('type', 'text');
19 document.body.appendChild(input);
20
21 // to test the radio box scenario
22 radioBox = document.createElement('input');
23 radioBox.setAttribute('type', 'radio');
24 document.body.appendChild(radioBox);
25
26 });
27
28 afterEach(function(){
29 el.parentNode.removeChild(el);
30 input.parentNode.removeChild(input);
31 radioBox.parentNode.removeChild(radioBox);
17 }); 32 });
18 33
19 describe('text', function() { 34 describe('text', function() {
......