Skip to content

test: fix stale types in the cognito and api-event-handler-aws tests - #5996

Merged
adrians5j merged 1 commit into
nextfrom
test/stale-test-types
Oct 14, 2026
Merged

adrians5j merged 1 commit into
nextfrom
test/stale-test-types

Conversation

@adrians5j

@adrians5j adrians5j commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What

yarn check:test:types failed for @webiny/cognito and @webiny/api-event-handler-aws on three test files. Vitest doesn't type-check, so the tests themselves passed.

  • packages/cognito/__tests__/mocks/MockCognitoService.ts and mocks/users.ts imported from features/shared and features/CreateAdminUser, which no longer exist. The imports are type-only, which is why nothing failed at runtime. They now import CognitoService from features/CognitoService and CreateAdminUserInput from features/CreateUser.
  • packages/api-event-handler-aws/__tests__/S3TenantLoaderDecorator.test.ts stubbed the inner S3EventHandler with one returning "inner-ok", but the handler returns void, and the test asserted on that string. The stub now returns nothing; the test still checks that the inner handler ran.

Test-only. No source changes.

Checks

  • yarn check:test:types -p cognito,api-event-handler-aws: 0 errors (was 3).
  • Tests pass: cognito (14), api-event-handler-aws (6).
  • adio, format, lint and sync-dependencies are clean.

Workspace: wby-next11 · STORAGE PER REQ

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated a test to verify tenant loading and handler execution without checking the handler’s return value.
  • Chores
    • Aligned a test mock’s service import with the Cognito feature abstractions.

The Cognito test mocks imported from modules that no longer exist
(features/shared, features/CreateAdminUser). The imports are type-only,
so vitest ran fine, but yarn check:test:types failed. They now import
from features/CognitoService and features/CreateUser.

The S3TenantLoaderDecorator test's inner handler returned a string,
while S3EventHandler returns void, and the test asserted on that string.
It now checks that the inner handler ran, which it already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adrians5j

Copy link
Copy Markdown
Member Author

/vitest

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Vitest tests have been initiated (for more information, click here). ✨

Group Status
No storage ✅ 75/75 passed
DDB ✅ 17/17 passed
DDB+OS ✅ 20/20 passed
SQL ✅ 13/13 passed
PGlite ✅ 13/13 passed

@github-actions

Copy link
Copy Markdown

🚓 Slop Cop

✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules.

Small, focused test-only diff matching the stated intent, with no style violations in the changed lines.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b7fc31a-762e-4b12-9d8c-a922d22ac007
📥 Commits

Reviewing files that changed from the base of the PR and between bcc1bf3 and 8d491ad.

📒 Files selected for processing: 3
  • packages/api-event-handler-aws/__tests__/S3TenantLoaderDecorator.test.ts
  • packages/cognito/__tests__/mocks/MockCognitoService.ts
  • packages/cognito/__tests__/mocks/users.ts
 __________________________
< Needle. Haystack. Found. >
 --------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@adrians5j
adrians5j merged commit ccde89b into next Oct 14, 2026
19 of 20 checks passed
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.

1 participant