-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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 client/server rendering coherency tests #2864
Add client/server rendering coherency tests #2864
Conversation
See the render to body is causing issues -- I can correct that no problem but would like to know if there are other things to correct/change before I do 😃 |
Thanks. |
…pare entire HTML document
Not sure why it's still failing. Worked perfectly in my dev environment with |
We run through BrowserStack, which tests against different browsers. Those are what's failing. On MobileSafari for iOS7 is failing for some internal reason ( I think we could stand to update the browser testing config. I'll put in a PR for that and you can rebase against master to get those changes, which will hopefully fix up things here. |
Thanks a lot @timdorr ! This worked locally so yeah, not quite sure why it's not working here on these browsers. I had to fiddle a bit with retrieving the DOM nodes etc. to get a coherent comparison but there's nothing too extraordinary going on in my tests either. Let me know when you've done the config update and I'll rebase. |
@levibotelho I just merged that in. Can you rebase now? |
…pare entire HTML document
…act-router into rendering-coherency-tests
No luck still :/. One thing I noticed is that the tests are running on Chromium 37 (dates back to June 2014) whereas my dev machine is running Chromium 47. I still don't see why it would fail the test itself is really basic. The only thing that I can think of is maybe the React-specific attributes that I strip out in the test code are slightly different in that version of Chromium. If there is a way to make the test output more verbose that would be nice. Otherwise I could add an eslint exception to allow console statements and do a The asynchronous handler test does appear to fail as expected, however. |
@timdorr I'm wondering if the test is failing because I'm using |
}) | ||
|
||
function executeRenderingComparisonTest(routes, callback) { | ||
match({ routes, location: targetLocation }, function (error, redirectLocation, renderProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the correct usage – this should be the set of routes, not the <Router>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks!
Why is the async |
Superseded by #2883. |
@taion I don't know. This is the output I get on my local machine.
Which seems to reproduce the issue. If I can lend a hand in any way let me know. |
Added test cases that compare rendering on the client and server (one of which fails intentionally). Hopefully these address the root cause but feel free to weigh in if they're not quite right.
See #2714