Skip to content

Commit 0fe0a3c

Browse files
CopilotTrueBrain
andcommitted
Add e2e test for Folder/Category IndexError fix
Co-authored-by: TrueBrain <1663690+TrueBrain@users.noreply.github.com>
1 parent 1c48af6 commit 0fe0a3c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

e2e/e2e_namespace_folder.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,16 @@ def test_folder_invalid_namespace(page: Page):
8282
expect(
8383
page.locator('text=Page name "Folder/Page2/Main Page" is in namespace "Page2" that does not exist.')
8484
).to_be_visible()
85+
86+
87+
def test_folder_category_no_crash(page: Page):
88+
"""Check that accessing Folder/Category doesn't cause an IndexError crash."""
89+
page.goto("http://localhost:8080/Folder/Category")
90+
91+
# Before the fix, this would crash with an IndexError when page_get_language
92+
# tried to access page.split("/")[2] on ["Folder", "Category"].
93+
# After the fix, it should show an appropriate error message.
94+
# Since Category is a namespace, it should show the namespace error message.
95+
expect(
96+
page.locator('text=Page name "Folder/Category/Main Page" is in namespace "Category" that does not exist.')
97+
).to_be_visible()

0 commit comments

Comments
 (0)