import { define, vdom } from '../../../src/index';

describe.only('vdom/ref', () => {
  function create(ref) {
    const Elem = define('x-test', {
      render() {
        vdom.element('div', { ref, id: 'test' });
      }
    });
    return new Elem();
  }

  it('can be a function', done => {
    create(node => {
      expect(node.tagName).to.equal('DIV');
      expect(node.id).to.equal('test');
      done();
    });
  });
});

@@ -57,13 +57,8 @@
 ribe
-.only
 ('vd
@@ -194,17 +194,68 @@
  id:
+ 'div' %7D, () =%3E vdom.element('span', %7B id: 'span' %7D,
  'test'
- %7D
+)
 );%0A 
@@ -307,11 +307,14 @@
 it('
-can
+should
  be 
@@ -351,35 +351,279 @@
 ate(
-node =%3E %7B%0A      expect(node
+() =%3E done());%0A  %7D);%0A%0A  it('should have access to all properties', done =%3E %7B%0A    create(node =%3E %7B%0A      expect(node.id).to.equal('div');%0A      done();%0A    %7D);%0A  %7D);%0A%0A  it('should have access to all descendants', done =%3E %7B%0A    create(node =%3E %7B%0A      expect(node.firstChild
 .tag
@@ -642,11 +642,12 @@
 al('
-DIV
+SPAN
 ');%0A
@@ -656,34 +656,105 @@
     expect(node.
-id
+firstChild.id).to.equal('span');%0A      expect(node.firstChild.textContent
 ).to.equal('test

Split out ref tests and write test to ensure ref callback has access to descendants.