DEV: add tests for --composer-height calculation (#17986)

Follow up for 2b43238973
This commit is contained in:
Arpit Jalan 2022-08-18 18:03:15 +05:30 committed by GitHub
parent 7b51ac418b
commit 1e58bed4d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

View File

@ -59,6 +59,35 @@ acceptance("Composer", function (needs) {
needs.hooks.afterEach(() => toggleCheckDraftPopup(false));
test("Composer is opened", async function (assert) {
await visit("/");
await click("#create-topic");
assert.strictEqual(
document.documentElement.style.getPropertyValue("--composer-height"),
"400px",
"sets --composer-height to 400px when creating topic"
);
await fillIn(
".d-editor-input",
"this is the *content* of a new topic post"
);
await click(".toggle-minimize");
assert.strictEqual(
document.documentElement.style.getPropertyValue("--composer-height"),
"40px",
"sets --composer-height to 40px when composer is minimized to draft mode"
);
await click(".toggle-fullscreen");
assert.strictEqual(
document.documentElement.style.getPropertyValue("--composer-height"),
"400px",
"sets --composer-height back to 400px when composer is opened from draft mode"
);
});
test("composer controls", async function (assert) {
await visit("/");
assert.ok(exists("#create-topic"), "the create button is visible");