PWA + test: manifest, icon, live-search test (were left uncommitted)
This commit is contained in:
1 parent
67274aed7d
commit
3f715434f0
3 files changed
+37
No files matched your search
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="14" fill="#f97316"/><text x="32" y="45" font-family="sans-serif" font-size="42" font-weight="700" text-anchor="middle" fill="#0e0f13">a</text></svg>
|
||||
|
After Width: | Height: | Size: 242 B |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "ani-web",
|
||||
"short_name": "ani-web",
|
||||
"start_url": "./",
|
||||
"scope": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#0e0f13",
|
||||
"theme_color": "#0e0f13",
|
||||
"icons": [{ "src": "icon.svg", "sizes": "any", "type": "image/svg+xml" }]
|
||||
}
|
||||
@@ -239,6 +239,32 @@ async def _recent_searches():
|
||||
await browser.close()
|
||||
|
||||
|
||||
def test_live_search():
|
||||
asyncio.run(_live_search())
|
||||
|
||||
|
||||
async def _live_search():
|
||||
# typing (no Enter) renders results in place; Enter still commits to ?q=
|
||||
# so results stay shareable/reloadable.
|
||||
async with async_playwright() as p:
|
||||
browser = await p.chromium.launch(args=LAUNCH_ARGS)
|
||||
page = await (await browser.new_context()).new_page()
|
||||
errors = []
|
||||
page.on("pageerror", lambda e: errors.append(str(e)))
|
||||
|
||||
await _login(page, "admin", "adminpw12345")
|
||||
await page.fill("#q", "chainsaw")
|
||||
# debounced live results must appear WITHOUT pressing Enter
|
||||
await page.wait_for_selector("main a.card", timeout=30000)
|
||||
assert "q=chainsaw" not in page.url, page.url
|
||||
# Enter commits the query to the URL
|
||||
await page.keyboard.press("Enter")
|
||||
await page.wait_for_function(
|
||||
"location.search.includes('q=chainsaw')", timeout=15000, polling=POLL)
|
||||
assert not errors, errors
|
||||
await browser.close()
|
||||
|
||||
|
||||
def test_auto_next_countdown():
|
||||
asyncio.run(_auto_next_countdown())
|
||||
|
||||
|
||||
Reference in new issue
Block a user