mirror of https://github.com/zulip/zulip.git
e2e-tests: Fix ensure_enter_does_not_send.
A variable in the Node.js context cannot be mutated by a function evaluated in the browser context. The boolean was also incorrectly inverted, and a click to open the dialog containing `enter_sends_choice` was missing. Co-authored-by: Aman Agrawal <amanagr@zulip.com> Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
ae7a21834e
commit
ca6b0d8c5a
|
@ -290,14 +290,14 @@ export function set_realm_url(new_realm_url: string): void {
|
|||
}
|
||||
|
||||
export async function ensure_enter_does_not_send(page: Page): Promise<void> {
|
||||
let enter_sends = false;
|
||||
await page.$eval(".enter_sends_false", (el) => {
|
||||
if ((el as HTMLElement).style.display !== "none") {
|
||||
enter_sends = true;
|
||||
}
|
||||
});
|
||||
// NOTE: Caller should ensure that the compose box is already open.
|
||||
const enter_sends = await page.$eval(
|
||||
".enter_sends_true",
|
||||
(el) => (el as HTMLElement).style.display !== "none",
|
||||
);
|
||||
|
||||
if (enter_sends) {
|
||||
await page.click(".open_enter_sends_dialog");
|
||||
const enter_sends_false_selector = ".enter_sends_choice input[value='false']";
|
||||
await page.waitForSelector(enter_sends_false_selector);
|
||||
await page.click(enter_sends_false_selector);
|
||||
|
|
Loading…
Reference in New Issue