From b6df1cfa24d45b2fe190a465c6486d313abe18c6 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Thu, 9 Mar 2017 11:19:49 -0500 Subject: [PATCH] test: Resets test fixture at the beginning of each test --- test/test.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index c6c0bd2a..070e8dfb 100644 --- a/test/test.js +++ b/test/test.js @@ -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"'); @@ -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();