editor: fix requirejs paths so that test will work again
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / elementsRegister.test.js
1 define(function(require) {
2     
3 'use strict';
4 /* globals describe, it */
5
6
7 var ElementsRegister = require('./elementsRegister.js'),
8     documentElement = require('./documentElement.js'),
9     chai = require('libs/chai');
10
11 var expect = chai.expect;
12
13 describe('Elements register', function() {
14     it('registers element for a tag', function() {
15         var register = new ElementsRegister(documentElement.DocumentNodeElement),
16             prototype = Object.create({});
17
18         register.register({
19             tag: 'div',
20             prototype: prototype,
21         });
22         var Element = register.getElement({tag: 'div'});
23         expect(Element.prototype).to.equal(prototype);
24     });
25     it('registers element for a class', function() {
26         var register = new ElementsRegister(documentElement.DocumentNodeElement),
27             prototype = Object.create({});
28
29         register.register({
30             tag: 'div',
31             klass: 'a.b',
32             prototype: prototype,
33         });
34         var Element = register.getElement({tag: 'div', klass: 'a.b.c'});
35         expect(Element.prototype).to.equal(prototype);
36     });
37 });
38
39
40 });