mirror of
https://github.com/sissbruecker/linkding.git
synced 2026-02-27 22:43:15 +08:00
Fix URL not updating on tag search
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
{# Filters #}
|
||||
<div class="crud-filters">
|
||||
<ld-form data-form-reset>
|
||||
<form method="get" class="mb-2">
|
||||
<form method="get" class="mb-2" data-turbo-frame="_top">
|
||||
<div class="form-group">
|
||||
<label class="form-label text-assistive" for="search">Search tags</label>
|
||||
<div class="input-group">
|
||||
|
||||
@@ -334,3 +334,28 @@ class TagManagementE2ETestCase(LinkdingE2ETestCase):
|
||||
self.assertEqual(
|
||||
Tag.objects.filter(owner=self.get_or_create_test_user()).count(), 2
|
||||
)
|
||||
|
||||
def test_search_updates_url_query_params(self):
|
||||
self.setup_tag(name="python")
|
||||
self.setup_tag(name="javascript")
|
||||
self.setup_tag(name="typescript")
|
||||
|
||||
self.open(reverse("linkding:tags.index"))
|
||||
|
||||
# Verify all tags are visible initially
|
||||
expect(self.locate_tag_row("python")).to_be_visible()
|
||||
expect(self.locate_tag_row("javascript")).to_be_visible()
|
||||
expect(self.locate_tag_row("typescript")).to_be_visible()
|
||||
|
||||
# Enter search term and submit
|
||||
search_input = self.page.get_by_placeholder("Search tags...")
|
||||
search_input.fill("script")
|
||||
self.page.get_by_role("button", name="Search").click()
|
||||
|
||||
# Wait for filtered results to appear
|
||||
expect(self.locate_tag_row("python")).not_to_be_visible()
|
||||
expect(self.locate_tag_row("javascript")).to_be_visible()
|
||||
expect(self.locate_tag_row("typescript")).to_be_visible()
|
||||
|
||||
# Verify URL contains search query param
|
||||
self.assertIn("search=script", self.page.url)
|
||||
|
||||
Reference in New Issue
Block a user