feat(render): add generic view factory based on the template commands

Part of #3605
Closes #4367
This commit is contained in:
Tobias Bosch
2015-09-25 09:43:21 -07:00
parent 0ed6fc4f6b
commit 1cf45757cd
11 changed files with 906 additions and 8 deletions
@@ -50,6 +50,25 @@ export function main() {
});
it('should be able to create text nodes and use them with the other APIs', () => {
var t = DOM.createTextNode('hello');
expect(DOM.isTextNode(t)).toBe(true);
var d = DOM.createElement('div');
DOM.appendChild(d, t);
expect(DOM.getInnerHTML(d)).toEqual('hello');
});
it('should set className via the class attribute', () => {
var d = DOM.createElement('div');
DOM.setAttribute(d, 'class', 'class1');
expect(d.className).toEqual('class1');
});
it('should allow to remove nodes without parents', () => {
var d = DOM.createElement('div');
expect(() => DOM.remove(d)).not.toThrow();
});
if (DOM.supportsDOMEvents()) {
describe('getBaseHref', () => {
beforeEach(() => DOM.resetBaseElement());