var test = require('tape');
var Quilt = require('../quilt');
var Backbone = require('backbone');
Backbone.$ = require('jquery/dist/jquery')(window);

test('data-show', function(t) {
  var view = new Quilt.View({
    template: function(){
      return '<p><i data-show="x"></i></p>';
    },
    model: new Backbone.Model({x: true})
  }).render();
  t.ok(!view.$('i').is('[class*=hide-view]'));
  view.model.set({x: false});
  t.ok(view.$('i').is('[class*=hide-view]'));
  t.end();
});

test('data-hide', function(t) {
  var view = new Quilt.View({
    template: function() {
      return '<p><i data-hide="x"></i></p>';
    },
    model: new Backbone.Model({x: true})
  }).render();
  t.ok(view.$('i').is('[class*=hide-view]'));
  view.model.set({x: false});
  t.ok(!view.$('i').is('[class*=hide-view]'));
  t.end();
});

test('missing model', 0, function(t) {
  new Quilt.View({
    template: function() {
      return '<p><i data-hide="x"></i></p>';
    }
  }).render();
  t.end();
});

@@ -242,27 +242,24 @@
    return '%3C
-p%3E%3C
 i data-show=
@@ -258,36 +258,32 @@
 ta-show=%22x%22%3E%3C/i%3E
-%3C/p%3E
 ';%0A    %7D,%0A    mo
@@ -567,35 +567,32 @@
 %0A      return '%3C
-p%3E%3C
 i data-hide=%22x%22%3E
@@ -587,36 +587,32 @@
 ta-hide=%22x%22%3E%3C/i%3E
-%3C/p%3E
 ';%0A    %7D,%0A    mo
@@ -904,11 +904,8 @@
 n '%3C
-p%3E%3C
 i da
@@ -924,11 +924,257 @@
 %3C/i%3E
+';%0A    %7D%0A  %7D).render();%0A  t.end();%0A%7D);%0A%0Atest('Multiple show views.', function(t) %7B%0A  var view = new Quilt.View(%7B%0A    model: new Backbone.Model(%7Bfoo: false, bar: false%7D),%0A    template: function() %7B%0A      return '%3Ci data-show=%22foo%22 data-hide=%22bar%22%3E
 %3C/
-p
+i
 %3E';%0A
@@ -1186,31 +1186,77 @@
 %0A  %7D).render();%0A
+  t.ok(view.$('i').is('%5Bclass*=hide-view%5D'));%0A
   t.end();%0A%7D);%0A

Add a test.