Skip to content

update asserts for role#11

Merged
lwlee2608 merged 2 commits intomainfrom
fix/unit-test
Feb 7, 2026
Merged

update asserts for role#11
lwlee2608 merged 2 commits intomainfrom
fix/unit-test

Conversation

@JckHoe
Copy link
Contributor

@JckHoe JckHoe commented Feb 6, 2026

Summary by CodeRabbit

  • Tests
    • Updated authentication test expectations to reflect role value change from "Student" to "User".

@JckHoe JckHoe requested a review from lwlee2608 February 6, 2026 11:46
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

Authentication system tests were updated to import internal/db/sqlc and to assert the user's role using the sqlc.UserRoleUser constant instead of the literal string "Student". Changes are confined to test expectations; no application business logic or control flow was modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I hopped through tests with a twitchy nose,
Replaced "Student" with a constant that glows,
sqlc.UserRoleUser now takes the stage,
Small change, neat fix, in the rabbit's page. 🐇✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'update asserts for role' is directly related to the changeset, which updates test assertions to expect sqlc.UserRoleUser instead of the string 'Student' for role values.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/unit-test

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@systemtest/tests/auth.go`:
- Line 27: Replace the magic string in the test assertion with the typed
constant: change the assert.Equal(t, "User", resp.Role) call to use the
UserRoleUser constant from the sqlc models package (import that package) so the
assertion becomes assert.Equal(t, sqlc.UserRoleUser, resp.Role); reference the
sqlc.UserRoleUser constant and ensure the package import is added so resp.Role
is compared against the canonical UserRoleUser value.

@lwlee2608 lwlee2608 merged commit d5f4523 into main Feb 7, 2026
3 checks passed
@lwlee2608 lwlee2608 deleted the fix/unit-test branch February 7, 2026 03:11
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.

2 participants