Skip to content

Commit

Permalink
Merge pull request #912 from bertdeblock/make-sure-focus-related-test…
Browse files Browse the repository at this point in the history
…-dont-fail-when-the-container-is-hidden
  • Loading branch information
rwjblue committed Apr 12, 2022
2 parents 27e7644 + ed643e1 commit 4720360
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions addon-test-support/index.js
Expand Up @@ -89,13 +89,14 @@ export function setupTestContainer() {
}

let params = QUnit.urlParams;
let containerVisibility = params.nocontainer ? 'hidden' : 'visible';

if (params.devmode || params.fullscreencontainer) {
testContainer.className = ' full-screen';
testContainer.classList.add('ember-testing-container-full-screen');
}

testContainer.style.visibility = containerVisibility;
if (params.nocontainer) {
testContainer.classList.add('ember-testing-container-hidden');
}
}

/**
Expand Down
9 changes: 7 additions & 2 deletions vendor/ember-qunit/test-container-styles.css
Expand Up @@ -30,7 +30,7 @@
transform: translateZ(0);
}

#ember-testing-container.full-screen {
#ember-testing-container.ember-testing-container-full-screen {
width: 100%;
height: 100%;
overflow: auto;
Expand All @@ -39,14 +39,19 @@
right: 0;
}

#ember-testing-container.ember-testing-container-hidden {
opacity: 0;
pointer-events: none;
}

#ember-testing {
width: 200%;
height: 200%;
transform: scale(0.5);
transform-origin: top left;
}

.full-screen #ember-testing {
.ember-testing-container-full-screen #ember-testing {
position: absolute;
width: 100%;
height: 100%;
Expand Down

0 comments on commit 4720360

Please sign in to comment.