Newer
Older
reroad-test / 2020-ryusei / aframe-master / tests / components / link.test.js
@ryusei ryusei on 22 Oct 2020 820 bytes パノラマ表示
/* global assert, process, setup, suite, test */
var entityFactory = require('../helpers').entityFactory;

suite('link', function () {
  var el;

  setup(function (done) {
    el = entityFactory();
    el.setAttribute('link', '');
    if (el.hasLoaded) { done(); }
    el.addEventListener('loaded', function () {
      done();
    });
  });

  test('does not initialize visual aspect by default', function () {
    assert.notOk(el.components.link.textEl);
    assert.notOk(el.components.link.sphereEl);
    assert.notOk(el.components.link.semiSphereEl);
  });

  test('initializes visual aspect if set', function () {
    el.setAttribute('link', 'visualAspectEnabled', true);
    assert.ok(el.components.link.textEl);
    assert.ok(el.components.link.sphereEl);
    assert.ok(el.components.link.semiSphereEl);
  });
});