message-screenshot: Update for removal of navigate global.

Commit 0200f48a12 (#17407) removed the
navigate global variable.  Use the K hotkey instead of evaluating
navigate.up().

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-03-26 15:53:30 -07:00 committed by Tim Abbott
parent 7f89cb9535
commit 62c5782f66
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
"use strict";
/* global $, CSS, navigate */
/* global $, CSS */
const path = require("path");
@ -60,8 +60,8 @@ async function run() {
// remove unread marker and don't select message
const marker = `#zfilt${CSS.escape(options.messageId)} .unread_marker`;
await page.evaluate((sel) => $(sel).remove(), marker);
await page.evaluate(() => navigate.up());
const messageBox = await page.$(messageSelector);
await page.keyboard.press("KeyK");
const messageGroup = (await messageBox.$x(".."))[0];
// Compute screenshot area, with some padding around the message group
const clip = {...(await messageGroup.boundingBox())};