diff --git a/web/e2e-tests/compose.test.ts b/web/e2e-tests/compose.test.ts index 13335f405e..0f22ae6dd9 100644 --- a/web/e2e-tests/compose.test.ts +++ b/web/e2e-tests/compose.test.ts @@ -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); } diff --git a/web/e2e-tests/lib/common.ts b/web/e2e-tests/lib/common.ts index 5bc2bb4b79..724755b5d4 100644 --- a/web/e2e-tests/lib/common.ts +++ b/web/e2e-tests/lib/common.ts @@ -318,7 +318,7 @@ export async function assert_compose_box_content( expected_value: string, ): Promise { 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; } diff --git a/web/e2e-tests/message-basics.test.ts b/web/e2e-tests/message-basics.test.ts index b72d12c103..0d43942b8f 100644 --- a/web/e2e-tests/message-basics.test.ts +++ b/web/e2e-tests/message-basics.test.ts @@ -6,7 +6,7 @@ import * as common from "./lib/common.ts"; async function get_stream_li(page: Page, stream_name: string): Promise { 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())}"]`; } diff --git a/web/e2e-tests/navigation.test.ts b/web/e2e-tests/navigation.test.ts index bc94dfa97e..6252de2583 100644 --- a/web/e2e-tests/navigation.test.ts +++ b/web/e2e-tests/navigation.test.ts @@ -66,7 +66,7 @@ async function navigate_to_private_messages(page: Page): Promise { async function test_reload_hash(page: Page): Promise { 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 { }); 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); diff --git a/web/e2e-tests/realm-creation.test.ts b/web/e2e-tests/realm-creation.test.ts index 42d9cc8711..0b87dd1474 100644 --- a/web/e2e-tests/realm-creation.test.ts +++ b/web/e2e-tests/realm-creation.test.ts @@ -36,7 +36,7 @@ async function realm_creation_tests(page: Page): Promise { // 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)); diff --git a/web/e2e-tests/stream_create.test.ts b/web/e2e-tests/stream_create.test.ts index 790bc98b47..c426ed5a4b 100644 --- a/web/e2e-tests/stream_create.test.ts +++ b/web/e2e-tests/stream_create.test.ts @@ -22,7 +22,7 @@ async function await_user_hidden(page: Page, name: string): Promise { async function add_user_to_stream(page: Page, name: string): Promise { 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); diff --git a/web/e2e-tests/user-deactivation.test.ts b/web/e2e-tests/user-deactivation.test.ts index 1199f4fd56..8d28e403da 100644 --- a/web/e2e-tests/user-deactivation.test.ts +++ b/web/e2e-tests/user-deactivation.test.ts @@ -20,7 +20,7 @@ async function navigate_to_user_list(page: Page): Promise { async function user_row(page: Page, name: string): Promise { 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())}"]`; }