forked from retoor/devplacepy
docs: add block/mute user relations, emoji-sync CLI, and uid indexes
- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications - Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py` - Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views - Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES` - Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import re
|
||||
import time
|
||||
from playwright.sync_api import expect
|
||||
from tests.conftest import BASE_URL
|
||||
from devplacepy.database import get_table
|
||||
import requests
|
||||
@@ -211,6 +213,49 @@ def test_messages_search_for_bob(alice):
|
||||
assert result.is_visible()
|
||||
|
||||
|
||||
def test_messages_search_first_result_highlighted(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/messages", wait_until="domcontentloaded")
|
||||
page.fill("#message-search", "bob_test")
|
||||
result = page.locator(".search-dropdown-item:has-text('bob_test')")
|
||||
result.wait_for(state="visible", timeout=5000)
|
||||
expect(result.first).to_have_class(re.compile(r"\bactive\b"))
|
||||
|
||||
|
||||
def test_messages_search_enter_opens_conversation(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/messages", wait_until="domcontentloaded")
|
||||
page.fill("#message-search", "bob_test")
|
||||
page.locator(".search-dropdown-item:has-text('bob_test')").wait_for(
|
||||
state="visible", timeout=5000
|
||||
)
|
||||
page.locator("#message-search").press("Enter")
|
||||
page.wait_for_url(re.compile(r"with_uid="), wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_messages_search_arrow_then_enter_opens_conversation(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/messages", wait_until="domcontentloaded")
|
||||
page.fill("#message-search", "bob_test")
|
||||
page.locator(".search-dropdown-item:has-text('bob_test')").wait_for(
|
||||
state="visible", timeout=5000
|
||||
)
|
||||
search = page.locator("#message-search")
|
||||
search.press("ArrowDown")
|
||||
search.press("Enter")
|
||||
page.wait_for_url(re.compile(r"with_uid="), wait_until="domcontentloaded")
|
||||
|
||||
|
||||
def test_messages_search_escape_closes_dropdown(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/messages", wait_until="domcontentloaded")
|
||||
page.fill("#message-search", "bob_test")
|
||||
result = page.locator(".search-dropdown-item:has-text('bob_test')")
|
||||
result.wait_for(state="visible", timeout=5000)
|
||||
page.locator("#message-search").press("Escape")
|
||||
expect(result).to_be_hidden()
|
||||
|
||||
|
||||
def test_messages_header_visible(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/messages", wait_until="domcontentloaded")
|
||||
|
||||
Reference in New Issue
Block a user