Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing ReactTestRenderer test #27463

Closed
wants to merge 2 commits into from
Closed

Add failing ReactTestRenderer test #27463

wants to merge 2 commits into from

Conversation

poteto
Copy link
Member

@poteto poteto commented Oct 4, 2023

Interestingly this only seems to fail in ReactTestRenderer, in the codesandbox it correctly shows the right value

https://codesandbox.io/s/unruffled-platform-95l8w7?file=/src/App.js

  ● ReactTestRenderer › timed out Suspense hidden subtrees should not be observable via toJSON › failing test

    expect(received).toEqual(expected) // deep equality

    Expected: "<div>Selected Filters: _selected_all_filters_</div>"
    Received: <div>Selected Filters: none</div>

      157 |
      158 |       const root = ReactTestRenderer.create(<Parent />);
    > 159 |       expect(root.toJSON()).toEqual(
          |                             ^
      160 |         '<div>Selected Filters: _selected_all_filters_</div>',
      161 |       );
      162 |     });

      at Object.<anonymous> (packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js:159:29)

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Oct 4, 2023
@react-sizebot
Copy link

react-sizebot commented Oct 4, 2023

Comparing: 0fba3ec...5c66252

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 174.46 kB 174.46 kB = 54.27 kB 54.27 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 176.31 kB 176.31 kB = 54.88 kB 54.88 kB
facebook-www/ReactDOM-prod.classic.js = 564.48 kB 564.48 kB = 99.37 kB 99.37 kB
facebook-www/ReactDOM-prod.modern.js = 548.21 kB 548.21 kB = 96.44 kB 96.44 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 5c66252

}

const root = ReactTestRenderer.create(<Parent />);
expect(root.toJSON()).toEqual('_selected_all_filters_');
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't the expected output be a <div>Selected filters: ...</div> or similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Simplified it, it should basically hit the selectedFilters == null condition and set it to the constant string

@poteto poteto force-pushed the lt/repro-D49750653 branch 2 times, most recently from 575bf63 to 1818d14 Compare October 4, 2023 23:27
@poteto poteto closed this Oct 12, 2023
@poteto poteto deleted the lt/repro-D49750653 branch October 12, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants