Skip to content
New issue

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

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

Already on GitHub? # to your account

HTML Reporter: Make it more obvious why diff is suppressed #795

Conversation

shivamdixit
Copy link
Contributor

If the depth of an object is more than 'Max Depth' specified in Qunit.dump then the diff is not displayed. This behavior is confusing. This PR will display a message to the user so that user knows why it is not displayed.

Refer: #793 (comment)

I'm confused with what text to display to the user since the user might not be aware of max depth. Any suggestions?

Screenshot:
qunit4

@scottgonzalez
Copy link
Contributor

Ideally it says what the current max depth is and provides a link to rerun with a higher max depth or no max depth.

@shivamdixit
Copy link
Contributor Author

@scottgonzalez I've updated the PR. Screenshot:

qunit5

  1. Added maxDepth in url parameter, maxDepth = -1 implies run the tests without any maxDepth.
  2. Although maxDepth = someVal in URL parameters will work, but not explicitly showing the option of inputting the value from user because the UI will be cluttered as we will need to add input box, button etc.
  3. Showing QUnit.dump.maxDepth as hint, in case user wants to change maxDepth.
  4. The color of Rerun looks dull in the message, any suggestions for a different color?
  5. As QUnit.dump is not in scope when we are parsing URL params, hence I've added extra property QUnit.config.maxDepth.

@jzaefferer Please provide your valuable suggestions as well.

@shivamdixit
Copy link
Contributor Author

I think the tests are failing because of the timeout. How can I re-run the tests?

message += "<tr class='test-message'><th>Message: </th><td>" +
"Diff suppressed as the depth of object is more than current max depth (" +
QUnit.config.maxDepth + ").<p>Hint: Use 'QUnit.dump.maxDepth' to run " +
" with a higher max depth or <a href='?maxDepth=-1'>" +
Copy link
Member

Choose a reason for hiding this comment

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

This should use setUrl() to generate QUnit specific URLs that include other URL parameters already present (filters etc.).

@jzaefferer
Copy link
Member

@shivamdixit thanks for the PR. I have very little bandwidth to review anything this week. I added one comment above. I'd like to discuss the general concept for tackling this issue, but that has to wait a few days.

@scottgonzalez
Copy link
Contributor

That screenshot looks great. You should wrap QUnit.config.maxDepth in <code> instead of quotes.

Fixing the styling of the rerun link should be very simple, but let's wait for the team to discuss.

@shivamdixit
Copy link
Contributor Author

@jzaefferer @scottgonzalez Thanks for your suggestions. I've updated the code.

@jzaefferer
Copy link
Member

Let's add some CSS to display the Rerun link properly, just change color to something with more contrast.

@shivamdixit
Copy link
Contributor Author

qunit5

How is it looking?

@leobalter
Copy link
Member

LGTM

@leobalter leobalter closed this in ecc33ac Mar 26, 2015
@jzaefferer jzaefferer mentioned this pull request Mar 27, 2015
@jzaefferer jzaefferer added this to the 1.18.0 milestone Apr 3, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants