'use strict';

var chai = require('chai'),
    vain = require('./../lib/vain');

chai.should();

describe('Vain', function() {
  describe('.render', function() {
    it('should return the same markup if no snippets were invoked', function() {
      var startMarkup = '<a href="http://google.com">Google <span>A search engine.</span></a>',
          renderResult = vain.render(startMarkup);

      renderResult.should.equal(startMarkup);
    });

    it('should pass in the entire matching node to a snippet', function(callback) {
      var startMarkup = '<a href="http://google.com" data-vain="test">Google <span>A search engine.</span></a>',
          snippetHandler = function($, element) {
            var passedInMarkup = $("<div />").append(element).html();

            passedInMarkup.should.equal(startMarkup);
            callback();
          },
          renderResult = vain.render(startMarkup, {snippets: {'test': snippetHandler}});
    });
  });
});

@@ -944,16 +944,496 @@
 %0A    %7D);
+%0A%0A    it('should return transformed node markup', function() %7B%0A      var startMarkup = '%3Ca href=%22http://google.com%22 data-vain=%22test%22%3EGoogle%3C/a%3E',%0A          expectedMarkup = '%3Ca href=%22http://google.com%22 class=%22fancy%22%3EGoogle%3C/a%3E',%0A          snippetHandler = function($, element) %7B%0A            $(element).addClass(%22fancy%22);%0A          %7D,%0A          renderResult = vain.render(startMarkup, %7Bsnippets: %7B'test': snippetHandler%7D%7D);%0A%0A      renderResult.should.equal(expectedMarkup);%0A    %7D);
 %0A  %7D);%0A%7D

Add a test for basic transformation testing.