Keep composers usable, group actions and notifications, and drop the tool-count cap
DevPlace CI / test (push) Failing after 3h10m39s
DevPlace CI / test (push) Failing after 3h10m39s
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from tests.conftest import BASE_URL
|
||||
from devplacepy.database import get_table, refresh_snapshot
|
||||
from devplacepy.utils import generate_uid
|
||||
|
||||
JSON = {"Accept": "application/json"}
|
||||
|
||||
|
||||
def _seed_votes(user_uid, count=4):
|
||||
now = datetime.now(timezone.utc).isoformat()
|
||||
table = get_table("notifications")
|
||||
for i in range(count):
|
||||
table.insert(
|
||||
{
|
||||
"uid": generate_uid(),
|
||||
"user_uid": user_uid,
|
||||
"type": "vote",
|
||||
"message": f"voter-{i} ++'d your post",
|
||||
"related_uid": user_uid,
|
||||
"target_url": "/posts/grouped-seed",
|
||||
"read": False,
|
||||
"created_at": now,
|
||||
}
|
||||
)
|
||||
refresh_snapshot()
|
||||
|
||||
|
||||
def test_grouped_notifications_card(alice, seeded_db):
|
||||
page, user = alice
|
||||
uid = get_table("users").find_one(username=user["username"])["uid"]
|
||||
_seed_votes(uid)
|
||||
try:
|
||||
page.goto(f"{BASE_URL}/notifications", wait_until="domcontentloaded")
|
||||
card = page.locator("[data-notification-group]").first
|
||||
expect(card).to_be_visible(timeout=10000)
|
||||
expect(card.locator(".notif-group-count")).to_have_text("×4")
|
||||
finally:
|
||||
get_table("notifications").delete(user_uid=uid, target_url="/posts/grouped-seed")
|
||||
refresh_snapshot()
|
||||
|
||||
|
||||
def test_grouping_toggle_on_profile_notifications_tab(alice):
|
||||
page, user = alice
|
||||
username = user["username"]
|
||||
page.goto(f"{BASE_URL}/profile/{username}?tab=notifications", wait_until="domcontentloaded")
|
||||
panel = page.locator("[data-notif-prefs]")
|
||||
expect(panel.locator("form[action$='/notifications/grouping']")).to_be_attached()
|
||||
expect(panel.locator("form[action$='/notifications/throttling']")).to_be_attached()
|
||||
expect(page.locator("[data-enter-to-submit-card]")).to_be_attached()
|
||||
@@ -4,7 +4,6 @@ from datetime import datetime, timedelta, timezone
|
||||
from tests.conftest import BASE_URL
|
||||
from devplacepy.database import get_table
|
||||
from devplacepy.utils import generate_uid
|
||||
import requests
|
||||
def _seed_news_seo():
|
||||
from datetime import datetime, timezone
|
||||
from devplacepy.database import get_table
|
||||
@@ -764,8 +763,6 @@ def test_message_notification_click_opens_conversation(app_server, browser, seed
|
||||
card = pa.locator(".notification-card").filter(has_text="sent you a message").first
|
||||
card.wait_for(state="visible", timeout=10000)
|
||||
card.locator("a.card-link").click()
|
||||
from devplacepy.database import get_table
|
||||
|
||||
bob_uid = get_table("users").find_one(username=seeded_db["bob"]["username"])["uid"]
|
||||
window = pa.locator(f".chat-window[data-chat-uid='{bob_uid}']")
|
||||
window.locator(".message-bubble:has-text('Click-through message from bob')").first.wait_for(
|
||||
|
||||
Reference in New Issue
Block a user