mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 00:35:50 +00:00
DEV: add tests for --composer-height calculation (#17986)
Follow up for 2b43238973
This commit is contained in:
parent
7b51ac418b
commit
1e58bed4d2
@ -59,6 +59,35 @@ acceptance("Composer", function (needs) {
|
|||||||
|
|
||||||
needs.hooks.afterEach(() => toggleCheckDraftPopup(false));
|
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) {
|
test("composer controls", async function (assert) {
|
||||||
await visit("/");
|
await visit("/");
|
||||||
assert.ok(exists("#create-topic"), "the create button is visible");
|
assert.ok(exists("#create-topic"), "the create button is visible");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user