-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: Replace hardcoded external Vercel URL in Sidebar with internal route #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,4 @@ yarn-error.log* | |
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
| venv/ | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||||
| from playwright.sync_api import Page, expect, sync_playwright | ||||||||||||
|
|
||||||||||||
| def test_sidebar_quizzes_link(page: Page): | ||||||||||||
| page.goto("http://localhost:3000/test-sidebar") | ||||||||||||
|
|
||||||||||||
| # Wait for sidebar to load | ||||||||||||
| page.wait_for_selector("aside") | ||||||||||||
|
|
||||||||||||
| # Find the Quizzes link in the sidebar | ||||||||||||
| quizzes_link = page.locator("aside a[href='/quizzes']") | ||||||||||||
|
|
||||||||||||
| # Verify the href is correct | ||||||||||||
| href = quizzes_link.get_attribute("href") | ||||||||||||
| assert href == "/quizzes", f"Expected href '/quizzes', got '{href}'" | ||||||||||||
|
|
||||||||||||
| print("Link is correct!") | ||||||||||||
|
|
||||||||||||
| # Take a screenshot | ||||||||||||
| page.screenshot(path="verification/sidebar.png") | ||||||||||||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Screenshot directory may not exist. The screenshot path 🛡️ Suggested defensive fix+import os
+
from playwright.sync_api import Page, expect, sync_playwright
def test_sidebar_quizzes_link(page: Page):And before the screenshot: # Take a screenshot
+ os.makedirs("verification", exist_ok=True)
page.screenshot(path="verification/sidebar.png")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| if __name__ == "__main__": | ||||||||||||
| with sync_playwright() as p: | ||||||||||||
| browser = p.chromium.launch(headless=True) | ||||||||||||
| page = browser.new_page() | ||||||||||||
| try: | ||||||||||||
| test_sidebar_quizzes_link(page) | ||||||||||||
| finally: | ||||||||||||
| browser.close() | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: APPLEPIE6969/StudyFlow
Length of output: 552
🏁 Script executed:
Repository: APPLEPIE6969/StudyFlow
Length of output: 1101
Update test to use an existing route with sidebar rendering.
The
/test-sidebarroute does not exist in the application. The test will fail when attempting to navigate to this non-existent endpoint. Use an existing route where the sidebar is rendered, such as/dashboard(which exists in the codebase), instead of/test-sidebar.🤖 Prompt for AI Agents