DEV: Make sure testing-container fits in the viewport (#17446)

This prevents tests failures when the browser viewport is too small.
This commit is contained in:
Jarek Radosz 2022-07-12 15:32:43 +02:00 committed by GitHub
parent 0f3109cc53
commit 0e61f332ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 2 deletions

View File

@ -1,9 +1,30 @@
document.body.insertAdjacentHTML(
"afterbegin",
`
<style>#ember-testing-container { position: fixed; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; transform: translateZ(0)} #ember-testing { width: 200%; height: 200%; transform: scale(0.5); transform-origin: top left; }</style>
<style>
#ember-testing-container {
position: fixed;
background: white;
bottom: 0;
right: 0;
width: 640px;
height: 384px;
overflow: auto;
z-index: 9999;
border: 1px solid #ccc;
transform: translateZ(0);
box-sizing: border-box;
max-height: 100vh;
}
#ember-testing {
width: 200%;
height: 200%;
transform: scale(0.5);
transform-origin: top left;
}
</style>
`
);
require('discourse/tests/test-boot-ember-cli');

View File

@ -19,3 +19,8 @@ $love: #fa6c8d !default;
@import "common/foundation/mixins";
@import "desktop";
@import "color_definitions";
#ember-testing-container {
box-sizing: border-box;
max-height: 100vh;
}