Merge siteroot application

This commit is contained in:
Sascha Ißbrücker
2025-03-09 05:50:05 +01:00
parent b037de14c9
commit 2d3bd13a12
84 changed files with 864 additions and 822 deletions

View File

@@ -11,7 +11,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
details_modal = self.open_details_modal(bookmark)
title = details_modal.locator("h2")
@@ -21,7 +21,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
# close with close button
details_modal = self.open_details_modal(bookmark)
@@ -44,7 +44,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
# archive
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
details_modal = self.open_details_modal(bookmark)
@@ -53,7 +53,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
self.assertReloads(0)
# unarchive
url = reverse("bookmarks:archived")
url = reverse("linkding:bookmarks.archived")
self.page.goto(self.live_server_url + url)
self.resetReloads()
@@ -67,7 +67,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
# mark as unread
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
details_modal = self.open_details_modal(bookmark)
@@ -92,7 +92,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
# share bookmark
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
details_modal = self.open_details_modal(bookmark)
@@ -112,7 +112,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
url = reverse("bookmarks:index") + f"?q={bookmark.title}"
url = reverse("linkding:bookmarks.index") + f"?q={bookmark.title}"
self.open(url, p)
details_modal = self.open_details_modal(bookmark)
@@ -130,7 +130,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
url = reverse("bookmarks:index") + f"?q={bookmark.title}"
url = reverse("linkding:bookmarks.index") + f"?q={bookmark.title}"
self.open(url, p)
details_modal = self.open_details_modal(bookmark)
@@ -154,7 +154,7 @@ class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
url = reverse("bookmarks:index") + f"?q={bookmark.title}"
url = reverse("linkding:bookmarks.index") + f"?q={bookmark.title}"
self.open(url, p)
details_modal = self.open_details_modal(bookmark)

View File

@@ -12,7 +12,7 @@ class BookmarkItemE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark(notes="Test notes")
with sync_playwright() as p:
page = self.open(reverse("bookmarks:index"), p)
page = self.open(reverse("linkding:bookmarks.index"), p)
notes = self.locate_bookmark(bookmark.title).locator(".notes")
expect(notes).to_be_hidden()

View File

@@ -37,7 +37,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_test_data()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
bookmark_list = self.locate_bookmark_list()
self.locate_bulk_edit_toggle().click()
@@ -75,7 +75,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_test_data()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived"), p)
self.open(reverse("linkding:bookmarks.archived"), p)
bookmark_list = self.locate_bookmark_list()
self.locate_bulk_edit_toggle().click()
@@ -113,7 +113,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_test_data()
with sync_playwright() as p:
self.open(reverse("bookmarks:index") + "?q=foo", p)
self.open(reverse("linkding:bookmarks.index") + "?q=foo", p)
bookmark_list = self.locate_bookmark_list()
self.locate_bulk_edit_toggle().click()
@@ -151,7 +151,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_test_data()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived") + "?q=foo", p)
self.open(reverse("linkding:bookmarks.archived") + "?q=foo", p)
bookmark_list = self.locate_bookmark_list()
self.locate_bulk_edit_toggle().click()
@@ -189,7 +189,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
page = self.open(url, p)
self.locate_bulk_edit_toggle().click()
@@ -213,7 +213,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
self.locate_bulk_edit_toggle().click()
@@ -230,7 +230,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
self.locate_bulk_edit_toggle().click()
@@ -252,7 +252,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
self.locate_bulk_edit_toggle().click()
@@ -278,7 +278,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(100)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
page = self.open(url, p)
bookmark_list = self.locate_bookmark_list()
@@ -310,7 +310,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(100)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
bookmark_list = self.locate_bookmark_list()

View File

@@ -44,7 +44,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5, prefix="bar")
with sync_playwright() as p:
url = reverse("bookmarks:index") + "?q=foo"
url = reverse("linkding:bookmarks.index") + "?q=foo"
self.open(url, p)
self.assertVisibleBookmarks(["foo 1", "foo 2", "foo 3", "foo 4", "foo 5"])
@@ -56,7 +56,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5, prefix="foo")
with sync_playwright() as p:
url = reverse("bookmarks:index") + "?sort=title_asc"
url = reverse("linkding:bookmarks.index") + "?sort=title_asc"
page = self.open(url, p)
first_item = page.locator("li[ld-bookmark-item]").first
@@ -72,7 +72,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(50, prefix="foo", suffix="-")
with sync_playwright() as p:
url = reverse("bookmarks:index") + "?q=foo&page=2"
url = reverse("linkding:bookmarks.index") + "?q=foo&page=2"
self.open(url, p)
# with descending sort, page two has 'foo 1' to 'foo 20'
@@ -88,7 +88,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_numbered_bookmarks(5)
with sync_playwright() as p:
url = reverse("bookmarks:index")
url = reverse("linkding:bookmarks.index")
self.open(url, p)
self.locate_bookmark("Bookmark 1").get_by_text("Archive").click()
@@ -108,7 +108,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.locate_bookmark("Bookmark 2").get_by_text("Archive").click()
@@ -120,7 +120,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.locate_bookmark("Bookmark 2").get_by_text("Remove").click()
self.locate_bookmark("Bookmark 2").get_by_text("Confirm").click()
@@ -136,7 +136,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
bookmark2.save()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
expect(self.locate_bookmark("Bookmark 2")).to_have_class("unread")
self.locate_bookmark("Bookmark 2").get_by_text("Unread").click()
@@ -152,7 +152,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
bookmark2.save()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
expect(self.locate_bookmark("Bookmark 2")).to_have_class("shared")
self.locate_bookmark("Bookmark 2").get_by_text("Shared").click()
@@ -165,7 +165,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.locate_bulk_edit_toggle().click()
self.locate_bookmark("Bookmark 2").locator(
@@ -183,7 +183,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.locate_bulk_edit_toggle().click()
self.locate_bookmark("Bookmark 2").locator(
@@ -201,7 +201,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived"), p)
self.open(reverse("linkding:bookmarks.archived"), p)
self.locate_bookmark("Archived Bookmark 2").get_by_text("Unarchive").click()
@@ -213,7 +213,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived"), p)
self.open(reverse("linkding:bookmarks.archived"), p)
self.locate_bookmark("Archived Bookmark 2").get_by_text("Remove").click()
self.locate_bookmark("Archived Bookmark 2").get_by_text("Confirm").click()
@@ -226,7 +226,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived"), p)
self.open(reverse("linkding:bookmarks.archived"), p)
self.locate_bulk_edit_toggle().click()
self.locate_bookmark("Archived Bookmark 2").locator(
@@ -244,7 +244,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
self.setup_fixture()
with sync_playwright() as p:
self.open(reverse("bookmarks:archived"), p)
self.open(reverse("linkding:bookmarks.archived"), p)
self.locate_bulk_edit_toggle().click()
self.locate_bookmark("Archived Bookmark 2").locator(
@@ -265,7 +265,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
)
with sync_playwright() as p:
self.open(reverse("bookmarks:shared"), p)
self.open(reverse("linkding:bookmarks.shared"), p)
self.locate_bookmark("My Bookmark 2").get_by_text("Archive").click()
@@ -290,7 +290,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
)
with sync_playwright() as p:
self.open(reverse("bookmarks:shared"), p)
self.open(reverse("linkding:bookmarks.shared"), p)
self.locate_bookmark("My Bookmark 2").get_by_text("Remove").click()
self.locate_bookmark("My Bookmark 2").get_by_text("Confirm").click()

View File

@@ -23,13 +23,15 @@ class CollapseSidePanelE2ETestCase(LinkdingE2ETestCase):
def test_side_panel_should_be_visible_by_default(self):
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.assertSidePanelIsVisible()
self.page.goto(self.live_server_url + reverse("bookmarks:archived"))
self.page.goto(
self.live_server_url + reverse("linkding:bookmarks.archived")
)
self.assertSidePanelIsVisible()
self.page.goto(self.live_server_url + reverse("bookmarks:shared"))
self.page.goto(self.live_server_url + reverse("linkding:bookmarks.shared"))
self.assertSidePanelIsVisible()
def test_side_panel_should_be_hidden_when_collapsed(self):
@@ -38,11 +40,13 @@ class CollapseSidePanelE2ETestCase(LinkdingE2ETestCase):
user.profile.save()
with sync_playwright() as p:
self.open(reverse("bookmarks:index"), p)
self.open(reverse("linkding:bookmarks.index"), p)
self.assertSidePanelIsHidden()
self.page.goto(self.live_server_url + reverse("bookmarks:archived"))
self.page.goto(
self.live_server_url + reverse("linkding:bookmarks.archived")
)
self.assertSidePanelIsHidden()
self.page.goto(self.live_server_url + reverse("bookmarks:shared"))
self.page.goto(self.live_server_url + reverse("linkding:bookmarks.shared"))
self.assertSidePanelIsHidden()

View File

@@ -31,7 +31,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
page = self.open(reverse("bookmarks:edit", args=[bookmark.id]), p)
page = self.open(reverse("linkding:bookmarks.edit", args=[bookmark.id]), p)
page.wait_for_timeout(timeout=1000)
page.get_by_text("This URL is already bookmarked.").wait_for(state="hidden")
@@ -42,7 +42,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
)
with sync_playwright() as p:
page = self.open(reverse("bookmarks:edit", args=[bookmark.id]), p)
page = self.open(reverse("linkding:bookmarks.edit", args=[bookmark.id]), p)
page.wait_for_timeout(timeout=1000)
title = page.get_by_label("Title")
@@ -54,7 +54,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
bookmark = self.setup_bookmark()
with sync_playwright() as p:
page = self.open(reverse("bookmarks:edit", args=[bookmark.id]), p)
page = self.open(reverse("linkding:bookmarks.edit", args=[bookmark.id]), p)
page.get_by_label("URL").fill("https://example.com")
page.wait_for_timeout(timeout=1000)

View File

@@ -10,7 +10,7 @@ class FilterDrawerE2ETestCase(LinkdingE2ETestCase):
self.setup_bookmark(tags=[self.setup_tag(name="hiking")])
with sync_playwright() as p:
page = self.open(reverse("bookmarks:index"), p)
page = self.open(reverse("linkding:bookmarks.index"), p)
# use smaller viewport to make filter button visible
page.set_viewport_size({"width": 375, "height": 812})
@@ -43,7 +43,7 @@ class FilterDrawerE2ETestCase(LinkdingE2ETestCase):
self.setup_bookmark(tags=[self.setup_tag(name="hiking")])
with sync_playwright() as p:
page = self.open(reverse("bookmarks:index"), p)
page = self.open(reverse("linkding:bookmarks.index"), p)
# use smaller viewport to make filter button visible
page.set_viewport_size({"width": 375, "height": 812})

View File

@@ -9,7 +9,7 @@ class GlobalShortcutsE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:index"))
page.goto(self.live_server_url + reverse("linkding:bookmarks.index"))
page.press("body", "s")
@@ -21,10 +21,12 @@ class GlobalShortcutsE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:index"))
page.goto(self.live_server_url + reverse("linkding:bookmarks.index"))
page.press("body", "n")
expect(page).to_have_url(self.live_server_url + reverse("bookmarks:new"))
expect(page).to_have_url(
self.live_server_url + reverse("linkding:bookmarks.new")
)
browser.close()

View File

@@ -30,7 +30,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
def test_enter_url_prefills_title_and_description(self):
with sync_playwright() as p:
page = self.open(reverse("bookmarks:new"), p)
page = self.open(reverse("linkding:bookmarks.new"), p)
url = page.get_by_label("URL")
title = page.get_by_label("Title")
description = page.get_by_label("Description")
@@ -43,7 +43,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
def test_enter_url_does_not_overwrite_modified_title_and_description(self):
with sync_playwright() as p:
page = self.open(reverse("bookmarks:new"), p)
page = self.open(reverse("linkding:bookmarks.new"), p)
url = page.get_by_label("URL")
title = page.get_by_label("Title")
description = page.get_by_label("Description")
@@ -58,7 +58,10 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
def test_with_initial_url_prefills_title_and_description(self):
with sync_playwright() as p:
page_url = reverse("bookmarks:new") + f"?url={quote('https://example.com')}"
page_url = (
reverse("linkding:bookmarks.new")
+ f"?url={quote('https://example.com')}"
)
page = self.open(page_url, p)
url = page.get_by_label("URL")
title = page.get_by_label("Title")
@@ -77,7 +80,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
):
with sync_playwright() as p:
page_url = (
reverse("bookmarks:new")
reverse("linkding:bookmarks.new")
+ f"?url={quote('https://example.com')}&title=Initial+title&description=Initial+description"
)
page = self.open(page_url, p)
@@ -102,7 +105,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
tag_names = " ".join(existing_bookmark.tag_names)
with sync_playwright() as p:
page = self.open(reverse("bookmarks:new"), p)
page = self.open(reverse("linkding:bookmarks.new"), p)
# Enter bookmarked URL
page.get_by_label("URL").fill(existing_bookmark.url)
@@ -135,7 +138,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
)
with sync_playwright() as p:
page = self.open(reverse("bookmarks:new"), p)
page = self.open(reverse("linkding:bookmarks.new"), p)
details = page.locator("details.notes")
expect(details).not_to_have_attribute("open", value="")
@@ -151,7 +154,7 @@ class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
# Open page with URL that should have auto tags
url = (
reverse("bookmarks:new")
reverse("linkding:bookmarks.new")
+ "?url=https%3A%2F%2Fgithub.com%2Fsissbruecker%2Flinkding"
)
page = self.open(url, p)

View File

@@ -10,7 +10,7 @@ class SettingsGeneralE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:settings.general"))
page.goto(self.live_server_url + reverse("linkding:settings.general"))
enable_sharing = page.get_by_label("Enable bookmark sharing")
enable_sharing_label = page.get_by_text("Enable bookmark sharing")
@@ -51,7 +51,7 @@ class SettingsGeneralE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:settings.general"))
page.goto(self.live_server_url + reverse("linkding:settings.general"))
max_lines = page.get_by_label("Bookmark description max lines")
expect(max_lines).to_be_hidden()
@@ -66,7 +66,7 @@ class SettingsGeneralE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:settings.general"))
page.goto(self.live_server_url + reverse("linkding:settings.general"))
max_lines = page.get_by_label("Bookmark description max lines")
expect(max_lines).to_be_visible()
@@ -75,7 +75,7 @@ class SettingsGeneralE2ETestCase(LinkdingE2ETestCase):
with sync_playwright() as p:
browser = self.setup_browser(p)
page = browser.new_page()
page.goto(self.live_server_url + reverse("bookmarks:settings.general"))
page.goto(self.live_server_url + reverse("linkding:settings.general"))
max_lines = page.get_by_label("Bookmark description max lines")
expect(max_lines).to_be_hidden()