Skip to content

refactor: strengthen createSession URL assertion#857

Open
empiricalrun[bot] wants to merge 11 commits intomainfrom
chat-session_rNYlBoB4UnhH
Open

refactor: strengthen createSession URL assertion#857
empiricalrun[bot] wants to merge 11 commits intomainfrom
chat-session_rNYlBoB4UnhH

Conversation

@empiricalrun
Copy link
Copy Markdown
Contributor

@empiricalrun empiricalrun Bot commented Apr 17, 2026

Summary

Identified that createSession() in tests/pages/sessions.ts had a loose URL check (/sessions/) after clicking "Create". This caused 9 test files to repeat a more specific URL assertion (/sessions/[^\/]+/) right after every createSession() call — a clear duplication.

Change (1 helper modification)

Updated createSession in tests/pages/sessions.ts to wait for the precise session detail URL:

// Before
await expect(page).toHaveURL(/sessions/);

// After
await expect(page).toHaveURL(/sessions\/[^\/]+/);

Cleanup (redundant assertions removed)

Removed the now-redundant follow-up URL checks from:

  • tests/tool-execution/session.spec.ts — 8 occurrences
  • tests/rename-file-tool.spec.ts — 1 occurrence

The 2 remaining toHaveURL(/sessions\/[^\/]+/) calls in tool-execution/session.spec.ts (line 160) and issues.spec.ts (line 148) are kept intentionally — they belong to custom session creation flows that don't use createSession().

Test Results

✅ Verified with a passing test run: https://reports-r2.empirical.run/test-gen-chat-agent/1776401978258/index.html

PR created from session #120971

Updated at 2026-04-17 05:01:03.475 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants