Skip to content

Commit

Permalink
tests: add cases where oldChild technique fails
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed May 12, 2019
1 parent 8399ffa commit 93c74f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions test/browser/components.test.js
Expand Up @@ -468,27 +468,27 @@ describe('Components', () => {
}

render(<App />, scratch);
expect(scratch.firstChild.innerHTML).to.equal('<div>abc<button>Add</button></div>' +
expect(scratch.firstChild.innerHTML).to.equal('<div>abc</div>' +
'<button>First Button</button><button>Second Button</button><button>Third Button</button>');

add();
rerender();
expect(scratch.firstChild.innerHTML).to.equal('<div>abc<button>Add</button></div><div>def<button>Add</button>' +
expect(scratch.firstChild.innerHTML).to.equal('<div>abc</div><div>def' +
'</div><button>First Button</button><button>Second Button</button><button>Third Button</button>');

add();
rerender();
expect(scratch.firstChild.innerHTML).to.equal('<div>abc<button>Add</button></div><div>def<button>Add</button></div><div>def<button>Add</button>' +
expect(scratch.firstChild.innerHTML).to.equal('<div>abc</div><div>def</div><div>def' +
'</div><button>First Button</button><button>Second Button</button><button>Third Button</button>');

reset();
rerender();
expect(scratch.firstChild.innerHTML).to.equal('<div>abc<button>Add</button></div>' +
expect(scratch.firstChild.innerHTML).to.equal('<div>abc</div>' +
'<button>First Button</button><button>Second Button</button><button>Third Button</button>');

addTwice();
rerender();
expect(scratch.firstChild.innerHTML).to.equal('<div>abc<button>Add</button></div><div>def<button>Add</button></div><div>ghi<button>Add</button>' +
expect(scratch.firstChild.innerHTML).to.equal('<div>abc</div><div>def</div><div>ghi' +
'</div><button>First Button</button><button>Second Button</button><button>Third Button</button>');
});

Expand Down
2 changes: 1 addition & 1 deletion test/browser/focus.test.js
Expand Up @@ -170,7 +170,7 @@ describe('focus', () => {
), scratch);
validateFocus(input, 'insert sibling before again');

expect(scratch.innerHTML).to.equal('<span>0</span><span>1</span><input type="text"><span>2</span><span>3</span>');
expect(scratch.innerHTML).to.equal('<div><span>0</span><span>1</span><input type="text"><span>2</span><span>3</span></div>');
});

it('should maintain focus when removing elements around input', () => {
Expand Down

0 comments on commit 93c74f2

Please sign in to comment.