Skip to content

Commit

Permalink
Add UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
powmedia committed Sep 12, 2011
1 parent 6fe9a26 commit eedc4b6
Show file tree
Hide file tree
Showing 17 changed files with 1,387 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/form.js
Expand Up @@ -91,7 +91,7 @@ test("commit() - updates the model with form values", function() {
equal(post.get('title'), 'New title');
});

test("Form.getValue() - returns form value as an object", function() {
test("getValue() - returns form value as an object", function() {
var data = {
title: 'Yuuup',
author: 'Lana Kang'
Expand Down
29 changes: 29 additions & 0 deletions test/index.html
Expand Up @@ -2,8 +2,11 @@
<html>
<head>
<link rel="stylesheet" href="lib/qunit.css" type="text/css" media="screen" />
<link rel="stylesheet" href="lib/jquery-ui/flick/jquery-ui-1.8.14.custom.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../src/backbone-forms.css" type="text/css" media="screen" />

<script src="lib/jquery-1.6.2.min.js"></script>
<script src="lib/jquery-ui/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="lib/qunit.js"></script>

<script src="lib/underscore-1.1.7.min.js"></script>
Expand All @@ -25,5 +28,31 @@ <h2 id="qunit-userAgent"></h2>
<script src="field.js"></script>
<script src="editors.js"></script>
<script src="jquery-ui-editors.js"></script>




<div id="uiTest"></div>
<script>
$(function() {
var Model = Backbone.Model.extend({
schema: {
date: { type: 'Date' },
datetime: { type: 'DateTime' },
list: { type: 'List' }
}
});

var model = new Model({
list: ['item1', 'item2', 'item3']
});

var form = new Backbone.Form({
model: model
}).render();

$('#uiTest').html(form.el);
});
</script>
</body>
</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
568 changes: 568 additions & 0 deletions test/lib/jquery-ui/flick/jquery-ui-1.8.14.custom.css

Large diffs are not rendered by default.

789 changes: 789 additions & 0 deletions test/lib/jquery-ui/jquery-ui-1.8.14.custom.min.js

Large diffs are not rendered by default.

0 comments on commit eedc4b6

Please sign in to comment.