add(ui/ux): show file formats in the scan and filter by them
This commit is contained in:
@@ -28,6 +28,9 @@ def server(tmp_path_factory):
|
||||
(downloads / "Eine Folge").mkdir(parents=True)
|
||||
for i in (1, 2):
|
||||
(downloads / "Eine Folge" / f"{i:02d}.mp3").write_bytes(b"")
|
||||
# one book in three formats, the case the format column exists for
|
||||
for ext in (".epub", ".azw3", ".pdf"):
|
||||
(downloads / f"Der Lehrer{ext}").write_bytes(b"x" * 2048)
|
||||
port = _free_port()
|
||||
proc = subprocess.Popen(
|
||||
[sys.executable, "-m", "uvicorn", "wordarr.main:app", "--port", str(port)],
|
||||
@@ -106,3 +109,18 @@ def test_import_dialog_opens_and_closes(page):
|
||||
page.keyboard.press("Escape")
|
||||
page.wait_for_timeout(150)
|
||||
assert not page.locator("#quick-dialog").is_visible()
|
||||
|
||||
|
||||
def test_format_tags_and_the_format_filter(page):
|
||||
page.click("nav button[data-view=import]")
|
||||
page.click("#scan-btn")
|
||||
page.wait_for_selector("[data-quick]")
|
||||
|
||||
tags = page.locator("#import-table .tag.fmt").all_text_contents()
|
||||
assert "azw3 · 2,0 KB" in tags
|
||||
assert "mp3" in " ".join(tags) # the audiobook folder is labelled too
|
||||
|
||||
page.select_option("#import-filter-format", "epub")
|
||||
rows = page.locator("#import-table tbody tr")
|
||||
assert rows.count() == 1
|
||||
assert "epub" in rows.first.locator(".tag.fmt").text_content()
|
||||
|
||||
Reference in New Issue
Block a user