Skip to content

Commit

Permalink
test: Resets test fixture at the beginning of each test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Morris committed Mar 9, 2017
1 parent a5d8cca commit b6df1cf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ var arrayValue = function(arr, key) {
};


// var assert = require('chai').assert;
var assert = chai.assert;
var fixture;

describe('form', function() {
before(function() {
fixture = $('#main').html();
});

beforeEach(function() {
$('#main').html(fixture);
});


it('"action" and "method" form attributes', function() {
var f = $('#form1');
assert.strictEqual(f.attr('action'), 'text.php', 'form "action"');
Expand Down Expand Up @@ -164,7 +173,7 @@ describe('form', function() {
assert.ok('' == val, 'success: ' + val);
});

// test resetForm
// test clearForm
it('clearForm (select)', function() {
var $el = $('#form1 select[name=Single]');
var val = $el.val();
Expand Down

0 comments on commit b6df1cf

Please sign in to comment.