Commit d457306b authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Started working on JS acceptance tests. Reorganized jasmine tests.

parent a0046754
...@@ -325,7 +325,7 @@ module.exports = function (grunt) { ...@@ -325,7 +325,7 @@ module.exports = function (grunt) {
'js/jqx-all.js', 'js/jqx-all.js',
'js/qfq.debug.js' 'js/qfq.debug.js'
], ],
helpers: ['tests/jasmine/unit/helper/mock-ajax.js'], helpers: ['tests/jasmine/helper/mock-ajax.js'],
template: 'tests/jasmine/unit/SpecRunner.tmpl' template: 'tests/jasmine/unit/SpecRunner.tmpl'
} }
} }
......
/**
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/* global describe */
/* global it */
/* global expect */
/* global QfqNS */
/* global beforeAll */
/* global beforeEach */
/* global jasmine */
/* global $ */
describe("File Upload Acceptance", function () {
'use strict';
function prepareForm(id) {
var $form;
var $template = $("#" + id);
$form = $('#myForm').empty();
$form.append($template.text());
}
it("handles no previous uploaded file present", function () {
prepareForm("fileupload_new");
jasmine.Ajax.install();
var bla = $('#fileupload')[0];
var qfqForm = new QfqNS.QfqForm("myForm", "", "", "", "", "");
$('#fileupload').trigger("change");
jasmine.Ajax.requests.mostRecent().respondWith({
"status": 200,
"contentType": "application/json",
"responseText": "{ \"status\": \"success\" }"
});
jasmine.Ajax.uninstall();
});
});
\ No newline at end of file
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>Jasmine Spec Runner v2.4.1</title> <title>Jasmine Spec Runner v2.4.1</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.4.1/jasmine_favicon.png"> <link rel="shortcut icon" type="image/png" href="../lib/jasmine-2.4.1/jasmine_favicon.png">
<link rel="stylesheet" href="lib/jasmine-2.4.1/jasmine.css"> <link rel="stylesheet" href="../lib/jasmine-2.4.1/jasmine.css">
<link rel="stylesheet" href="../../../css/bootstrap.min.css"> <link rel="stylesheet" href="../../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../../css/bootstrap-theme.min.css"> <link rel="stylesheet" href="../../../css/bootstrap-theme.min.css">
<script src="lib/jasmine-2.4.1/jasmine.js"></script> <script src="../lib/jasmine-2.4.1/jasmine.js"></script>
<script src="lib/jasmine-2.4.1/jasmine-html.js"></script> <script src="../lib/jasmine-2.4.1/jasmine-html.js"></script>
<script src="lib/jasmine-2.4.1/boot.js"></script> <script src="../lib/jasmine-2.4.1/boot.js"></script>
<script src="helper/mock-ajax.js"></script> <script src="../helper/mock-ajax.js"></script>
<script src="../../../js/jquery.min.js"></script> <script src="../../../js/jquery.min.js"></script>
<script src="../../../js/bootstrap.min.js"></script> <script src="../../../js/bootstrap.min.js"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment