Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions e2e/cypress/e2e/sessions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ describe('Ambient Session Management Tests', () => {
body: { data: { ANTHROPIC_API_KEY: apiKey } }
})).then((r) => expect(r.status).to.eq(200))

// Create a session for UI tests
// Wait for the workspace page to finish loading before creating a session
cy.get('[data-testid="new-session-btn"]', { timeout: 20000 }).should('be.visible')
cy.get('[data-testid="new-session-btn"]').click()
Comment on lines +80 to 82
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Redundant element query; chain the click for consistency.

Line 81 queries the element with a timeout, but line 82 re-queries without one. This is inconsistent with the chained pattern used in lines 184 and 248. Chain the click directly to avoid the redundant query.

Proposed fix
     // Wait for the workspace page to finish loading before creating a session
-    cy.get('[data-testid="new-session-btn"]', { timeout: 20000 }).should('be.visible')
-    cy.get('[data-testid="new-session-btn"]').click()
+    cy.get('[data-testid="new-session-btn"]', { timeout: 20000 }).should('be.visible').click()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/cypress/e2e/sessions.cy.ts` around lines 80 - 82, Chained element queries
are inconsistent: instead of calling cy.get(selector, { timeout: ... }) and then
re-querying the same selector before clicking, chain .click() directly off the
initial cy.get call used around lines 80–82 in sessions.cy.ts (replace the
redundant cy.get(...).click() with the original cy.get(..., { timeout: ...
}).click()). Remove the duplicate query so the click uses the timeout-aware
subject and matches the chaining pattern used elsewhere (e.g., the patterns at
lines ~184 and ~248).

cy.get('[data-testid="create-session-submit"]', { timeout: 10000 })
.should('not.be.disabled').click()
Expand Down Expand Up @@ -180,7 +181,7 @@ describe('Ambient Session Management Tests', () => {

it('should open create session dialog and interact with form', () => {
cy.visit(`/projects/${workspaceSlug}`)
cy.get('[data-testid="new-session-btn"]', { timeout: 10000 }).click()
cy.get('[data-testid="new-session-btn"]', { timeout: 10000 }).should('be.visible').click()

// Create session dialog — covers create-session-dialog.tsx
cy.get('[data-testid="create-session-submit"]', { timeout: 10000 }).should('exist')
Expand Down Expand Up @@ -244,7 +245,7 @@ describe('Ambient Session Management Tests', () => {

// Step 1: Create session
cy.visit(`/projects/${workspaceSlug}`)
cy.get('[data-testid="new-session-btn"]').click()
cy.get('[data-testid="new-session-btn"]', { timeout: 10000 }).should('be.visible').click()
cy.get('[data-testid="create-session-submit"]', { timeout: 10000 })
.should('not.be.disabled').click()
cy.url({ timeout: 30000 }).should('match', /\/projects\/.*\/sessions\/[a-z0-9-]+$/)
Expand Down
Loading