Skip to content

Commit 4c02622

Browse files
committed
Disable tests of recovering from node.normalize()
According to #9836 we're intentionally chosing to not support this until we have better proof of this being a big need. E.g. to protect against extensions. In a way that it's not better to push extensions to be fixed.
1 parent 5aa3153 commit 4c02622

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

scripts/fiber/tests-failing.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,3 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js
33
* should not blow away user-entered text on successful reconnect to a controlled checkbox
44
* should not blow away user-selected value on successful reconnect to an uncontrolled select
55
* should not blow away user-selected value on successful reconnect to an controlled select
6-
7-
src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
8-
* can reconcile text merged by Node.normalize() alongside other elements
9-
* can reconcile text merged by Node.normalize()
10-
* can reconcile text arbitrarily split into multiple nodes
11-
* can reconcile text arbitrarily split into multiple nodes on some substitutions only

src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ describe('ReactDOMTextComponent', () => {
7474
expect(childNodes[2].data).toBe('bar');
7575
});
7676

77-
it('can reconcile text merged by Node.normalize() alongside other elements', () => {
77+
/**
78+
* The following Node.normalize() tests are intentionally failing.
79+
* See #9836 tracking whether we'll need to fix this or if it's unnecessary.
80+
*/
81+
82+
xit('can reconcile text merged by Node.normalize() alongside other elements', () => {
7883
var el = document.createElement('div');
7984
var inst = ReactDOM.render(
8085
<div>{'foo'}{'bar'}{'baz'}<span />{'qux'}</div>,
@@ -89,7 +94,7 @@ describe('ReactDOMTextComponent', () => {
8994
expect(container.textContent).toBe('barbazquxfoo');
9095
});
9196

92-
it('can reconcile text merged by Node.normalize()', () => {
97+
xit('can reconcile text merged by Node.normalize()', () => {
9398
var el = document.createElement('div');
9499
var inst = ReactDOM.render(<div>{'foo'}{'bar'}{'baz'}</div>, el);
95100

@@ -116,7 +121,7 @@ describe('ReactDOMTextComponent', () => {
116121
expect(el.textContent).toBe('');
117122
});
118123

119-
it('can reconcile text arbitrarily split into multiple nodes', () => {
124+
xit('can reconcile text arbitrarily split into multiple nodes', () => {
120125
var el = document.createElement('div');
121126
var inst = ReactDOM.render(<div><span />{'foobarbaz'}</div>, el);
122127

@@ -138,7 +143,7 @@ describe('ReactDOMTextComponent', () => {
138143
expect(container.textContent).toBe('barbazqux');
139144
});
140145

141-
it('can reconcile text arbitrarily split into multiple nodes on some substitutions only', () => {
146+
xit('can reconcile text arbitrarily split into multiple nodes on some substitutions only', () => {
142147
var el = document.createElement('div');
143148
var inst = ReactDOM.render(
144149
<div><span />{'bar'}<span />{'foobarbaz'}{'foo'}{'barfoo'}<span /></div>,
@@ -171,4 +176,19 @@ describe('ReactDOMTextComponent', () => {
171176
container = ReactDOM.findDOMNode(inst);
172177
expect(container.textContent).toBe('bazbarbazquxbarbazbar');
173178
});
179+
180+
xit('can unmount normalized text nodes', () => {
181+
var el = document.createElement('div');
182+
ReactDOM.render(
183+
<div>{''}{'foo'}{'bar'}</div>,
184+
el,
185+
);
186+
el.normalize();
187+
ReactDOM.render(
188+
<div></div>,
189+
el,
190+
);
191+
expect(el.innerHTML).toBe('<div></div>');
192+
});
193+
174194
});

0 commit comments

Comments
 (0)