- expect(Element.prototype.testMethod).to.equal(prototype.testMethod, '1');
- expect(Element.prototype instanceof documentElement.DocumentNodeElement).to.equal(true, '2');
- });
- it('allows inheriting from selected element', function() {
- var register = new ElementsRegister(documentElement.DocumentNodeElement),
- method1 = function() {},
- method2 = function() {};
-
- register.register({
- tag: 'div',
- prototype: {method1: method1}
- });
-
- register.register({
- tag: 'div',
- klass: 'a',
- prototype: {method2: method2},
- extending: {tag: 'div'}
- });
-
- var Element = register.getElement({tag: 'div', klass: 'a'});
- expect(Element.prototype.method2).to.equal(method2, '2');
- expect(Element.prototype instanceof register.getElement({tag: 'div'})).to.equal(true, '2');