- Notifications
You must be signed in to change notification settings - Fork11.2k
test: Improve create teams handler tests#25213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.<file name="packages/trpc/server/routers/viewer/organizations/__tests__/createTeams.handler.test.ts"><violation number="1" location="packages/trpc/server/routers/viewer/organizations/__tests__/createTeams.handler.test.ts:189">The new "NoOrganizationError" test still asserts a FORBIDDEN/not_authorized response, so it never verifies the missing-organization error path and simply duplicates the previous authorization test.</violation></file>Reply to cubic to teach it or ask questions. Re-run a review with@cubic-dev-ai review this PR
| creationSource:CreationSource.WEBAPP, | ||
| }, | ||
| }) | ||
| ).rejects.toMatchObject({ |
cubic-dev-aibotNov 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The new "NoOrganizationError" test still asserts a FORBIDDEN/not_authorized response, so it never verifies the missing-organization error path and simply duplicates the previous authorization test.
Prompt for AI agents
Address the following comment on packages/trpc/server/routers/viewer/organizations/__tests__/createTeams.handler.test.ts at line 189:<comment>The new "NoOrganizationError" test still asserts a FORBIDDEN/not_authorized response, so it never verifies the missing-organization error path and simply duplicates the previous authorization test.</comment><file context>@@ -123,354 +139,1120 @@ async function createScenario(options: CreateScenarioOptions = {}) {+ creationSource: CreationSource.WEBAPP,+ },+ })+ ).rejects.toMatchObject({+ code: "FORBIDDEN",+ message: "not_authorized",</file context>
eunjae-lee left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This looks solid !
rodrigoehlers left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM!
f0e1012 intomainUh oh!
There was an error while loading.Please reload this page.
sean-brydon commentedNov 17, 2025
Merge activity
|
Uh oh!
There was an error while loading.Please reload this page.
I am refactoring create teams handler to a service in another PR - thought we should improve the test in the mean time.
Summary by cubic
Expand and restructure tests for createTeamsHandler to cover auth, org/slug validation, team creation and migration, redirects, credits, invites, and subscriptions. This improves reliability ahead of the service refactor.
Written for commit8c216c6. Summary will update automatically on new commits.