Skip to content

Commit b6df1cf

Browse files
author
Kevin Morris
committed
test: Resets test fixture at the beginning of each test
1 parent a5d8cca commit b6df1cf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/test.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,19 @@ var arrayValue = function(arr, key) {
2424
};
2525

2626

27-
// var assert = require('chai').assert;
2827
var assert = chai.assert;
28+
var fixture;
2929

3030
describe('form', function() {
31+
before(function() {
32+
fixture = $('#main').html();
33+
});
34+
35+
beforeEach(function() {
36+
$('#main').html(fixture);
37+
});
38+
39+
3140
it('"action" and "method" form attributes', function() {
3241
var f = $('#form1');
3342
assert.strictEqual(f.attr('action'), 'text.php', 'form "action"');
@@ -164,7 +173,7 @@ describe('form', function() {
164173
assert.ok('' == val, 'success: ' + val);
165174
});
166175

167-
// test resetForm
176+
// test clearForm
168177
it('clearForm (select)', function() {
169178
var $el = $('#form1 select[name=Single]');
170179
var val = $el.val();

0 commit comments

Comments
 (0)