Skip to content

fix(webapp): add hasAdminDisplayAccess to the env param test mock - #4430

Merged
1stvamp merged 1 commit into
mainfrom
fix/env-param-test-mock
Jul 31, 2026
Merged

fix(webapp): add hasAdminDisplayAccess to the env param test mock#4430
1stvamp merged 1 commit into
mainfrom
fix/env-param-test-mock

Conversation

@1stvamp

@1stvamp 1stvamp commented Jul 31, 2026

Copy link
Copy Markdown
Member

test/envParamRoute.ownership.test.ts fails on main: 3 of its 4 tests throw

Error: [vitest] No "hasAdminDisplayAccess" export is defined on the
"~/services/session.server" mock. Did you forget to return it from "vi.mock"?

#4421 added a hasAdminDisplayAccess(user) call to the env.$envParam loader, and the test's vi.mock of session.server only returns requireUser, so the call blows up. Both changes were green in their own PR and only conflict once merged together, which is why nobody caught it.

The mock now mirrors the real implementation rather than returning a constant, so it stays correct if the test's user fixture is ever varied. No assertions were changed: the tests were right, the mock was stale.

Worth flagging separately: no workflow runs on push to main, so this has been red since #4421 landed without showing up anywhere. Every PR opened since has inherited the failure.

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 92562c2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The ownership test adds a hasAdminDisplayAccess session-service mock. The mock accepts admin, impersonation, and optional user-viewing state. It grants access to admins or impersonating users when they are not viewing as another user.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the added hasAdminDisplayAccess mock in the affected webapp test.
Description check ✅ Passed The description clearly explains the failure, root cause, fix, and testing context, but it omits the template checklist, issue reference, and screenshot section.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/env-param-test-mock

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.

❤️ Share

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

@1stvamp 1stvamp self-assigned this Jul 31, 2026
@1stvamp
1stvamp marked this pull request as ready for review July 31, 2026 02:51

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@1stvamp
1stvamp merged commit efcb89a into main Jul 31, 2026
39 checks passed
@1stvamp
1stvamp deleted the fix/env-param-test-mock branch July 31, 2026 08:44
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