Skip to content

Commit

Permalink
this was fixed by #4054
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jul 2, 2023
1 parent 76d6909 commit 6553f47
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/browser/refs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,25 +509,23 @@ describe('refs', () => {
expect(ref.current).to.equal(scratch.firstChild.firstChild);
});

// TODO
it.skip('should properly call null for memoized components keyed', () => {
const calls = [];
it('should properly call null for memoized components keyed', () => {
let calls = [];
const element = <div ref={x => calls.push(x)}>hey</div>;
function App(props) {
return <div key={props.count}>{element}</div>;
}

render(<App count={0} />, scratch);
expect(calls).to.deep.equal([scratch.firstChild.firstChild]);
calls = [];

render(<App count={1} />, scratch);
expect(calls).to.deep.equal([null, scratch.firstChild.firstChild]);
calls = [];

render(<App count={2} />, scratch);
expect(calls.length).to.equal(5);
expect(calls).to.deep.equal([
scratch.firstChild.firstChild,
null,
scratch.firstChild.firstChild,
null,
scratch.firstChild.firstChild
]);
expect(calls).to.deep.equal([null, scratch.firstChild.firstChild]);
});

it('should properly call null for memoized components unkeyed', () => {
Expand Down

0 comments on commit 6553f47

Please sign in to comment.