Fix unassigned variable#52
Conversation
Added more compatibility questions
Added compatibility question tests and verifications Updated tests to cover Keywords and Headline changes recently made Updated tests to cover all of the big5 personality traits
Updated signUp.spec.ts to use new fixture Updated Account information variable names Deleted "deleteUserFixture.ts" as it was incorporated into the "base.ts" file
Updated seedDatabase.ts to throw an error if the user already exists, to also add display names and usernames so they seedUser func acts like a normal basic user Some organising of the google auth code
Added account deletion checks
Updated filters.tsx: added data testid
Added data test attributes to search.tsx and profile-grid.tsx
|
@O-Bots is attempting to deploy a commit to the Compass Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughFixes: (1) peoplePage.verifyNumberOfMatchingProfiles now reads and parses profile-count text content and asserts equality; (2) corrected final closing ChangesTest Utility Verification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/e2e/web/pages/peoplePage.ts`:
- Around line 428-433: The current verifyNumberOfMatchingProfiles silently
returns when textContent() is falsy and uses textContent() which doesn't
auto-wait; instead remove the silent early return and replace the manual
read+parse with Playwright's auto-waiting assertion on the locator
(this.profileCount) — e.g. use
expect(this.profileCount).toHaveText(count.toString()) or, if the element
contains extra text, expect(this.profileCount).toHaveText(new
RegExp(`\\b${count}\\b`)); keep or drop the explicit visibility check as desired
but do not use textContent() nor an early return in
verifyNumberOfMatchingProfiles so failures surface reliably.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 30b37b49-e4d1-46b7-80a8-5a4864325f39
📒 Files selected for processing (1)
tests/e2e/web/pages/peoplePage.ts
| async verifyNumberOfMatchingProfiles(count: number) { | ||
| await expect(this.profileCount).toBeVisible() | ||
| const test = await this.profileCount.textContent() | ||
| if (!test) return | ||
| expect(actual).toStrictEqual(expected) | ||
| const actualCount = await this.profileCount.textContent() | ||
| if (!actualCount) return | ||
| expect(parseInt(actualCount)).toStrictEqual(count) | ||
| } |
There was a problem hiding this comment.
Silent early return masks failures and textContent() skips Playwright auto-waiting.
Two concerns with the new assertion logic:
if (!actualCount) returnturns a missing/empty profile-count element into a silent pass. A verification method should fail loudly when the value under test cannot be read — otherwise a regression that empties the count element will go undetected.textContent()is a one-shot DOM read with no retry. If the count updates asynchronously after applying filters, the assertion can race the UI. Preferexpect(locator).toHaveText(...), which auto-waits/retries until the timeout, eliminating the need to manually parse and guard.
♻️ Suggested refactor
async verifyNumberOfMatchingProfiles(count: number) {
await expect(this.profileCount).toBeVisible()
- const actualCount = await this.profileCount.textContent()
- if (!actualCount) return
- expect(parseInt(actualCount)).toStrictEqual(count)
+ await expect(this.profileCount).toHaveText(String(count))
}If the element contains additional text around the number (e.g. "42 profiles"), use a regex variant instead:
await expect(this.profileCount).toHaveText(new RegExp(`\\b${count}\\b`))🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/e2e/web/pages/peoplePage.ts` around lines 428 - 433, The current
verifyNumberOfMatchingProfiles silently returns when textContent() is falsy and
uses textContent() which doesn't auto-wait; instead remove the silent early
return and replace the manual read+parse with Playwright's auto-waiting
assertion on the locator (this.profileCount) — e.g. use
expect(this.profileCount).toHaveText(count.toString()) or, if the element
contains extra text, expect(this.profileCount).toHaveText(new
RegExp(`\\b${count}\\b`)); keep or drop the explicit visibility check as desired
but do not use textContent() nor an early return in
verifyNumberOfMatchingProfiles so failures surface reliably.
Bug I introduce in PR #51
Summary by CodeRabbit