mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 19:57:18 +08:00
FIX: more resilient whisper state between composer states (#6687)
This commit is contained in:
@ -366,28 +366,36 @@ QUnit.test("Composer can toggle between edit and reply", async assert => {
|
||||
});
|
||||
|
||||
QUnit.test("Composer can toggle whispers", async assert => {
|
||||
const menu = selectKit(".toolbar-popup-menu-options");
|
||||
|
||||
await visit("/t/this-is-a-test-topic/9");
|
||||
await click(".topic-post:eq(0) button.reply");
|
||||
|
||||
await selectKit(".toolbar-popup-menu-options").expand();
|
||||
await selectKit(".toolbar-popup-menu-options").selectRowByValue(
|
||||
"toggleWhisper"
|
||||
);
|
||||
await menu.expand();
|
||||
await menu.selectRowByValue("toggleWhisper");
|
||||
|
||||
assert.ok(
|
||||
find(".composer-fields .whisper .d-icon-eye-slash").length === 1,
|
||||
"it sets the post type to whisper"
|
||||
);
|
||||
|
||||
await selectKit(".toolbar-popup-menu-options").expand();
|
||||
await selectKit(".toolbar-popup-menu-options").selectRowByValue(
|
||||
"toggleWhisper"
|
||||
);
|
||||
await menu.expand();
|
||||
await menu.selectRowByValue("toggleWhisper");
|
||||
|
||||
assert.ok(
|
||||
find(".composer-fields .whisper .d-icon-eye-slash").length === 0,
|
||||
"it removes the whisper mode"
|
||||
);
|
||||
|
||||
await menu.expand();
|
||||
await menu.selectRowByValue("toggleWhisper");
|
||||
|
||||
await click(".toggle-fullscreen");
|
||||
|
||||
assert.ok(
|
||||
menu.rowByValue("toggleWhisper").exists(),
|
||||
"whisper toggling is still present when going fullscreen"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test(
|
||||
|
Reference in New Issue
Block a user