Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Let Fiber skip react data attributes and comments in SSR tests
This markup is testing implementation details rather than behavior.
  • Loading branch information
sebmarkbage committed Nov 23, 2016
commit 72f13887f85f6718e08409d9e1da6a738319a3f1
19 changes: 0 additions & 19 deletions scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,6 @@ src/renderers/dom/stack/client/__tests__/ReactRenderDocument-test.js
* should throw on full document render w/ no markup
* supports findDOMNode on full-page components

src/renderers/dom/stack/server/__tests__/ReactServerRendering-test.js
* should generate simple markup
* should generate simple markup for self-closing tags
* should generate simple markup for attribute with `>` symbol
* should generate comment markup for component returns null
* should render composite components
* should only execute certain lifecycle methods
* should have the correct mounting behavior
* should not put checksum and React ID on components
* should not put checksum and React ID on text components
* should only execute certain lifecycle methods
* allows setState in componentWillMount without using DOM
* renders components with different batching strategies
* warns with a no-op when an async setState is triggered
* warns with a no-op when an async replaceState is triggered
* warns with a no-op when an async forceUpdate is triggered
* should warn when children are mutated during render

src/renderers/shared/__tests__/ReactPerf-test.js
* should count no-op update as waste
* should count no-op update in child as waste
Expand All @@ -150,7 +132,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactComponentLifeCycle-test.js
* should carry through each of the phases of setup

src/renderers/shared/stack/reconciler/__tests__/ReactCompositeComponent-test.js
* should not thrash a server rendered layout with client side one
* should warn about `forceUpdate` on unmounted components
* should warn about `setState` on unmounted components
* should warn about `setState` in render
Expand Down
3 changes: 3 additions & 0 deletions scripts/fiber/tests-passing-except-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ src/renderers/dom/stack/client/__tests__/ReactMountDestruction-test.js
* should warn when unmounting a non-container root node
* should warn when unmounting a non-container, non-root node

src/renderers/dom/stack/server/__tests__/ReactServerRendering-test.js
* should have the correct mounting behavior

src/renderers/shared/hooks/__tests__/ReactComponentTreeHook-test.js
* uses displayName or Unknown for classic components
* uses displayName, name, or ReactComponent for modern components
Expand Down
16 changes: 16 additions & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,23 @@ src/renderers/dom/stack/client/__tests__/findDOMNode-test.js
* findDOMNode should not throw an error when called within a component that is not mounted

src/renderers/dom/stack/server/__tests__/ReactServerRendering-test.js
* should generate simple markup
* should generate simple markup for self-closing tags
* should generate simple markup for attribute with `>` symbol
* should generate comment markup for component returns null
* should render composite components
* should only execute certain lifecycle methods
* should throw with silly args
* should not put checksum and React ID on components
* should not put checksum and React ID on text components
* should only execute certain lifecycle methods
* should throw with silly args
* allows setState in componentWillMount without using DOM
* renders components with different batching strategies
* warns with a no-op when an async setState is triggered
* warns with a no-op when an async replaceState is triggered
* warns with a no-op when an async forceUpdate is triggered
* should warn when children are mutated during render

src/renderers/native/__tests__/ReactNativeAttributePayload-test.js
* should work with simple example
Expand Down Expand Up @@ -1231,6 +1246,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactComponentLifeCycle-test.js
src/renderers/shared/stack/reconciler/__tests__/ReactCompositeComponent-test.js
* should support module pattern components
* should support rendering to different child types over time
* should not thrash a server rendered layout with client side one
* should react to state changes from callbacks
* should rewire refs when rendering to different child types
* should not cache old DOM nodes when switching constructors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var ExecutionEnvironment;
var React;
var ReactDOM;
var ReactDOMFeatureFlags;
var ReactDOMServer;
var ReactMarkupChecksum;
var ReactReconcileTransaction;
Expand All @@ -27,6 +28,7 @@ describe('ReactDOMServer', () => {
jest.resetModuleRegistry();
React = require('React');
ReactDOM = require('ReactDOM');
ReactDOMFeatureFlags = require('ReactDOMFeatureFlags');
ReactMarkupChecksum = require('ReactMarkupChecksum');
ReactTestUtils = require('ReactTestUtils');
ReactReconcileTransaction = require('ReactReconcileTransaction');
Expand Down Expand Up @@ -241,7 +243,17 @@ describe('ReactDOMServer', () => {

var instance = ReactDOM.render(<TestComponent name="x" />, element);
expect(mountCount).toEqual(3);
expect(element.innerHTML).toBe(lastMarkup);

var expectedMarkup = lastMarkup;
if (ReactDOMFeatureFlags.useFiber) {
var reactMetaData = /\s+data-react[a-z-]+=\"[^\"]*\"/g;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: " doesn't need \

var reactComments = /<!-- \/?react-text(: \d+)? -->/g;
expectedMarkup =
expectedMarkup
.replace(reactMetaData, '')
.replace(reactComments, '');
}
expect(element.innerHTML).toBe(expectedMarkup);

// Ensure the events system works after mount into server markup
expect(numClicks).toEqual(0);
Expand Down