Skip to content

Commit

Permalink
Add test for fragment ordering (#1478)
Browse files Browse the repository at this point in the history
* test

* skip test

* pr remarks
  • Loading branch information
JoviDeCroock authored and marvinhagemeister committed Mar 29, 2019
1 parent 46f0738 commit fddb511
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/browser/fragments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,38 @@ describe('Fragment', () => {
expect(scratch.innerHTML).to.equal('hello <span>world</span>');
});

it.skip('should handle reordering', () => {
class X extends Component {
render() {
return <Fragment>{this.props.children}</Fragment>;
}
}

class App extends Component {
render(props) {
if (this.props.i === 0) {
return (
<div>
<X key={1}>1</X>
<X key={2}>2</X>
</div>
);
}
return (
<div>
<X key={2}>2</X>
<X key={1}>1</X>
</div>
);
}
}

render(<App i={0} />, scratch);
expect(scratch.textContent).to.equal('12');
render(<App i={1} />, scratch);
expect(scratch.textContent).to.equal('21');
});

it.skip('should preserve state of children with 1 level nesting', () => {
function Foo({ condition }) {
return condition ? (
Expand Down

0 comments on commit fddb511

Please sign in to comment.