mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
eslint: Fix unicorn/consistent-assert.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
37c9505a46
commit
a309bbe121
@@ -85,7 +85,7 @@ async function test_reply_by_click_prepopulates_private_message_recipient(
|
||||
await private_message.click();
|
||||
await page.waitForSelector("#private_message_recipient", {visible: true});
|
||||
const email = await common.get_internal_email_from_name(page, common.fullname.cordelia);
|
||||
assert(email !== undefined);
|
||||
assert.ok(email !== undefined);
|
||||
await common.pm_recipient.expect(page, email);
|
||||
await close_compose_box(page);
|
||||
}
|
||||
|
@@ -318,7 +318,7 @@ export async function assert_compose_box_content(
|
||||
expected_value: string,
|
||||
): Promise<void> {
|
||||
const compose_box_element = await page.waitForSelector("textarea#compose-textarea");
|
||||
assert(compose_box_element !== null);
|
||||
assert.ok(compose_box_element !== null);
|
||||
const compose_box_content = await page.evaluate(
|
||||
(element) => element.value,
|
||||
compose_box_element,
|
||||
@@ -408,7 +408,7 @@ export async function select_stream_in_compose_via_dropdown(
|
||||
const stream_to_select = `.dropdown-list-container .list-item[data-name="${stream_name}"]`;
|
||||
await page.waitForSelector(stream_to_select, {visible: true});
|
||||
await page.click(stream_to_select);
|
||||
assert((await page.$(".dropdown-list-container")) === null);
|
||||
assert.ok((await page.$(".dropdown-list-container")) === null);
|
||||
}
|
||||
|
||||
// Wait for any previous send to finish, then send a message.
|
||||
@@ -757,6 +757,6 @@ export async function get_current_msg_list_id(
|
||||
);
|
||||
}
|
||||
last_current_msg_list_id = await page.evaluate(() => zulip_test.current_msg_list?.id);
|
||||
assert(last_current_msg_list_id !== undefined);
|
||||
assert.ok(last_current_msg_list_id !== undefined);
|
||||
return last_current_msg_list_id;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import * as common from "./lib/common.ts";
|
||||
|
||||
async function get_stream_li(page: Page, stream_name: string): Promise<string> {
|
||||
const stream_id = await common.get_stream_id(page, stream_name);
|
||||
assert(stream_id !== undefined);
|
||||
assert.ok(stream_id !== undefined);
|
||||
return `#stream_filters [data-stream-id="${CSS.escape(stream_id.toString())}"]`;
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,7 @@ async function navigate_to_private_messages(page: Page): Promise<void> {
|
||||
|
||||
async function test_reload_hash(page: Page): Promise<void> {
|
||||
const initial_page_load_time = await page.evaluate(() => zulip_test.page_load_time);
|
||||
assert(initial_page_load_time !== undefined);
|
||||
assert.ok(initial_page_load_time !== undefined);
|
||||
console.log(`initial load time: ${initial_page_load_time}`);
|
||||
|
||||
const initial_hash = await page.evaluate(() => window.location.hash);
|
||||
@@ -81,7 +81,7 @@ async function test_reload_hash(page: Page): Promise<void> {
|
||||
});
|
||||
|
||||
const page_load_time = await page.evaluate(() => zulip_test.page_load_time);
|
||||
assert(page_load_time !== undefined);
|
||||
assert.ok(page_load_time !== undefined);
|
||||
assert.ok(page_load_time > initial_page_load_time, "Page not reloaded.");
|
||||
|
||||
const hash = await page.evaluate(() => window.location.hash);
|
||||
|
@@ -36,7 +36,7 @@ async function realm_creation_tests(page: Page): Promise<void> {
|
||||
|
||||
// Open the confirmation URL
|
||||
const page_content = await page.evaluate(() => document.querySelector("body")!.textContent);
|
||||
assert(page_content !== null);
|
||||
assert.ok(page_content !== null);
|
||||
const {confirmation_key} = z
|
||||
.object({confirmation_key: z.string()})
|
||||
.parse(JSON.parse(page_content));
|
||||
|
@@ -22,7 +22,7 @@ async function await_user_hidden(page: Page, name: string): Promise<void> {
|
||||
|
||||
async function add_user_to_stream(page: Page, name: string): Promise<void> {
|
||||
const user_id = await common.get_user_id_from_name(page, name);
|
||||
assert(user_id !== undefined);
|
||||
assert.ok(user_id !== undefined);
|
||||
await page.evaluate((user_id) => {
|
||||
zulip_test.add_user_id_to_new_stream(user_id);
|
||||
}, user_id);
|
||||
|
@@ -20,7 +20,7 @@ async function navigate_to_user_list(page: Page): Promise<void> {
|
||||
|
||||
async function user_row(page: Page, name: string): Promise<string> {
|
||||
const user_id = await common.get_user_id_from_name(page, name);
|
||||
assert(user_id !== undefined);
|
||||
assert.ok(user_id !== undefined);
|
||||
return `.user_row[data-user-id="${CSS.escape(user_id.toString())}"]`;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user