search: Use pills in the search bar.

This initial commit is fairly bare-bones, and does not have the full
contemplated functionality.
This commit is contained in:
evykassirer
2024-01-25 13:11:22 -08:00
committed by Tim Abbott
parent 0ab4f84561
commit 38e58ea3d6
10 changed files with 296 additions and 136 deletions

View File

@@ -179,7 +179,11 @@ async function search_and_check(
): Promise<void> {
await page.click(".search_icon");
await page.waitForSelector(".navbar-search.expanded", {visible: true});
// Close the "in: home" pill
await page.click(".navbar-search .pill-close-button");
await common.select_item_via_typeahead(page, "#search_query", search_str, item_to_select);
// Enter to trigger search
await page.keyboard.press("Enter");
await check(page);
assert.strictEqual(await page.title(), expected_narrow_title);
await un_narrow(page);
@@ -189,7 +193,11 @@ async function search_and_check(
async function search_silent_user(page: Page, str: string, item: string): Promise<void> {
await page.click(".search_icon");
await page.waitForSelector(".navbar-search.expanded", {visible: true});
// Close the "in: home" pill
await page.click(".navbar-search .pill-close-button");
await common.select_item_via_typeahead(page, "#search_query", str, item);
// Enter to trigger search
await page.keyboard.press("Enter");
await page.waitForSelector(".empty_feed_notice", {visible: true});
const expect_message = "You haven't received any messages sent by Email Gateway yet.";
assert.strictEqual(
@@ -224,7 +232,11 @@ async function expect_non_existing_users(page: Page): Promise<void> {
async function search_non_existing_user(page: Page, str: string, item: string): Promise<void> {
await page.click(".search_icon");
await page.waitForSelector(".navbar-search.expanded", {visible: true});
// Close the "in: home" pill
await page.click(".navbar-search .pill-close-button");
await common.select_item_via_typeahead(page, "#search_query", str, item);
// Enter to trigger search
await page.keyboard.press("Enter");
await expect_non_existing_user(page);
await un_narrow(page);
await expect_home(page);