import test from 'ava';
import jsdom from 'jsdom';
import nunjucks from 'nunjucks';

import { Accordion } from './Accordion';

test.beforeEach(t => {
  global.document = jsdom.jsdom(nunjucks.render(`./Accordion.test.html`));
});

// @todo: Write real tests
test('Can initialize Accordion', t => {
  Accordion.init('#accordion');
  t.truthy(Accordion.accordion);
  t.is(Accordion.transitionDuration, 300);
});

test('Can initialize Accordion transitionDuration', t => {
  Accordion.init('#accordion', 100);
  t.is(Accordion.transitionDuration, 100);
});

@@ -77,17 +77,16 @@
 jucks';%0A
-%0A
 import %7B
@@ -119,16 +119,64 @@
 dion';%0A%0A
+import %7Benv%7D from '../../nunjucks-helper.js';%0A%0A%0A
 test.bef
@@ -226,26 +226,29 @@
 dom(
-nunjucks.render(%60.
+env.render('accordion
 /Acc
@@ -267,9 +267,9 @@
 html
-%60
+'
 ));%0A

Load nunjucks env and update template path