-
Notifications
You must be signed in to change notification settings - Fork 32
Static positioning the testing container does not work. #33
Copy link
Copy link
Open
Description
You actually need to apply static positioning to all elements between the element that tether positions and the body.
This is how I currently manage to make it work, it's a bit of a brute force fix, but atleast it works.
// Set position static to short-circuit Hubspot Tether's positioning
// https://github.com/HubSpot/tether/pull/98/
const FIX_ELEMENT_ID = 'tether_fix_style_element';
export function insertTetherFix() {
let styleElement = document.createElement('style');
styleElement.id = FIX_ELEMENT_ID;
styleElement.innerText =
'#ember-testing-container, #ember-testing-container * {' +
'position: static !important;' +
'}';
document.body.appendChild(styleElement);
}
export function removeTetherFix() {
let styleElement = document.getElementById(FIX_ELEMENT_ID);
document.body.removeChild(styleElement);
}then:
test('test something', function(assert) {
insertTetherFix();
// test something
andThen(() => removeTetherFix());
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels