-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Fixes testing container layout issues for QUnit 2.14 #817
Conversation
Marking this as a draft for cross-browser and app testing. |
Wow thanks for doing this, @drewlee. Really appreciate you looking into fixing this. |
Updated PR with the following changes:
Visually verified fixes on Safari, Chrome (Win/Mac), Firefox (Win/Mac), and Edge (Win/Mac). |
I created a minimal reproduction case demonstrating the visibility-related false-negatives at https://github.com/drewlee/ember-qunit-layout-bugs/. Yarn linking to this set of fixes allows the test to pass as expected. |
Agree. How much more work is this to include here? |
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 looks really good to me. Once @rwjblue's question is sorted I think this is GTG.
@rwjblue should be fairly straightforward, would just need to remove and streamline some of the CSS/JS. I can probably push out an update by EOD. |
Makes "docked container" layout the default, which effectively means that:
I've found it necessary to apply a small right gutter for the testing container so that it doesn't occlude the test results scroll bar. This is done automatically by the browser when the layout reverts to the previous version (below 500px height). |
This change attempts to address the numerous issues that have been introduced by the CSS positional updates in QUnit 2.14.0, including #793 and #801. Besides visual layout problems, the relative percentage-based dimensions introduced in PR #786 have been found to cause random test failures in existing applications, especially those which assert visibility states. The modifications did not consider that the ember testing container resides in qunit's fixture for v5. These have also been found to cause
ember-a11y-testing
failures with false-positives/negatives.Given that the QUnit layout is now
position: fixed
based, it is no longer possible for the testing container to fall directly below the test results. As such, the container now also requires fixed positioning in relation to the viewport, similar to the "docked container" layout.To follow the convention applied in https://github.com/qunitjs/qunit/pull/1513/files, the proposed fixes ensure that the UI reverts to the old layouts if the browser doesn't support CSS
flex
display, or the viewport height is constricted below the 500px threshold. Percentage based dimensions have been reverted back to fixed pixels to prevent testing container jank and false-positive/negative failures mentioned above. I've iterated over a bunch of different ways of remediating these problems, and believe this is probably the most balanced approach between usability and not having to override a bunch of QUnit's styling.For the default layout, the proposed fix pins the testing container to the bottom of the viewport and centered, essentially dividing the screen into two horizontal panes with some semblance of the old layout.
Default view:
Test results scrolled to bottom:
Viewport below 500px height (or lack of
flex
support) reverts back to old layout.Top:
Bottom:
The "docked container" option pretty much remains similar and pins the testing container to the bottom right side of the screen.
Default view:
Test results scrolled to bottom:
Height constriction (or lack of
flex
support) reverts to old layoutDev mode:
Notable items:
docked-container
CSS class to thebody
.