ember-tether
ember-tether copied to clipboard
Static positioning the testing container does not work.
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());
});