Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Use nodename in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Sep 16, 2016
1 parent 65b62e8 commit 98b9861
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/src/ui/vdom.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ describe('ui/vdom', () => {

it('should create a real DOM node from a virtual DOM node', () => {
let node = realize(h.div([h.a(), h.img()]));
expect(node.localName).to.be('div');
expect(node.firstChild.localName).to.be('a');
expect(node.lastChild.localName).to.be('img');
expect(node.nodeName.toLowerCase()).to.be('div');
expect(node.firstChild.nodeName.toLowerCase()).to.be('a');
expect(node.lastChild.nodeName.toLowerCase()).to.be('img');
});

});
Expand All @@ -283,7 +283,7 @@ describe('ui/vdom', () => {
it('should render virtual DOM content into a host elememnt', () => {
let host = document.createElement('div');
render(h.img(), host);
expect(host.firstChild.localName).to.be('img');
expect(host.firstChild.nodeName.toLowerCase()).to.be('img');
});

it('should render the delta from the previous rendering', () => {
Expand All @@ -293,13 +293,13 @@ describe('ui/vdom', () => {

let first = host.firstChild;
let last = host.lastChild;
expect(first.localName).to.be('a');
expect(last.localName).to.be('img');
expect(first.nodeName.toLowerCase()).to.be('a');
expect(last.nodeName.toLowerCase()).to.be('img');
children = [children[0], new VNode('text', 'foo', {}, []), children[1]];
render(children, host);
expect(host.firstChild).to.be(first);
expect(host.lastChild).to.not.be(last);
expect(host.lastChild.localName).to.be('span');
expect(host.lastChild.nodeName.toLowerCase()).to.be('span');
});

it('should clear the rendering if `null` content is provided', () => {
Expand Down Expand Up @@ -359,7 +359,7 @@ describe('ui/vdom', () => {
newChildren[3] = h.div({ key: '5' });
render(newChildren, host);
let newChild = host.lastChild;
expect(newChild.localName).to.be('div');
expect(newChild.nodeName.toLowerCase()).to.be('div');
});

it('should update the text of a text node', () => {
Expand Down

0 comments on commit 98b9861

Please sign in to comment.