Quiiz system

This commit is contained in:
2026-07-26 16:46:41 +02:00
parent 7f17d69f5c
commit 4780016980
192 changed files with 15031 additions and 566 deletions
+33
View File
@@ -3,6 +3,8 @@
import re
from playwright.sync_api import expect
from tests.conftest import BASE_URL
UNICORN = "\U0001F984"
def _open_composer(page):
page.goto(f"{BASE_URL}/feed", wait_until="domcontentloaded")
page.locator(".feed-fab").first.wait_for(state="visible", timeout=10000)
@@ -37,3 +39,34 @@ def test_reaction_palette_toggle_and_react(alice):
expect(
page.locator(".reaction-chip.reacted").first.locator(".reaction-count")
).to_have_text("1")
def test_reaction_with_an_emoji_outside_the_palette(alice):
page, _ = alice
_create_plain_post_engagement_ui(page, "Post to react to with an off-palette emoji.")
page.locator(".reaction-add-btn").first.click()
page.locator(".reaction-palette-more").first.click()
picker = page.locator(".reaction-picker").first
picker.wait_for(state="visible")
picker.locator("emoji-picker").wait_for(state="attached")
page.evaluate(
"""(unicode) => {
const picker = document.querySelector(".reaction-picker emoji-picker");
picker.dispatchEvent(new CustomEvent("emoji-click", { detail: { unicode } }));
}""",
UNICORN,
)
chip = page.locator(f'.reaction-chip[data-reaction-emoji="{UNICORN}"]')
expect(chip).to_be_visible()
expect(chip).to_have_class(re.compile("reacted"))
expect(chip.locator(".reaction-count")).to_have_text("1")
expect(picker).to_be_hidden()
page.reload(wait_until="domcontentloaded")
reloaded = page.locator(f'.reaction-chip[data-reaction-emoji="{UNICORN}"]')
expect(reloaded).to_be_visible()
expect(reloaded.locator(".reaction-count")).to_have_text("1")