Skip to content

Commit

Permalink
moved test utils to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn van de Rijdt committed Mar 26, 2013
1 parent c258b40 commit ce58cdc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions js_tests/SpecRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<script type="text/javascript" src="../src/js/connection.js"></script>

<!-- include spec files here... -->
<script type="text/javascript" src="utils/test_utils.js"></script>
<script type="text/javascript" src="specs/form.spec.js"></script>
<script type="text/javascript" src="specs/storage.spec.js"></script>
<script type="text/javascript" src="specs/connection.spec.js"></script>
Expand Down
1 change: 1 addition & 0 deletions js_tests/SpecRunner_c.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<script type="text/javascript" src="../src/js/connection.js"></script>

<!-- include spec files here... -->
<script type="text/javascript" src="utils/test_utils.js"></script>
<script type="text/javascript" src="specs/form.spec.js"></script>
<script type="text/javascript" src="specs/storage.spec.js"></script>
<script type="text/javascript" src="specs/connection.spec.js"></script>
Expand Down
1 change: 1 addition & 0 deletions js_tests/SpecRunner_drishti.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<script type="text/javascript" src="../src/js/form.js"></script>

<!-- include spec files here... -->
<script type="text/javascript" src="utils/test_utils.js"></script>
<script type="text/javascript" src="specs/transform.spec.js"></script>

<script type="text/javascript">
Expand Down
11 changes: 11 additions & 0 deletions js_tests/utils/test_utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var loadForm = function(filename, editStr){
var strings = mockForms1[filename];
return new Form(strings.html_form, strings.xml_model, editStr);
};

var getFormDataO = function(filename){
//$('body').append('<form></form>');
var form = new Form('<form></form>', mockForms1[filename].xml_model);
form.init();
return form.getDataO();
};

0 comments on commit ce58cdc

Please sign in to comment.