Skip to content

test: add unit tests for flagged-accounts (re #885) - #903

Open
Ishaan-Gpt wants to merge 1 commit into
Coder-s-OG-s:mainfrom
Ishaan-Gpt:test-flagged-accounts-885
Open

Ishaan-Gpt wants to merge 1 commit into
Coder-s-OG-s:mainfrom
Ishaan-Gpt:test-flagged-accounts-885

Conversation

@Ishaan-Gpt

Copy link
Copy Markdown

Summary

Adds unit tests for the flagged-account maintainer actions in src/app/actions/maintainer/flagged-accounts.ts, covering one file from the #885 checklist (one test file per PR). The suite covers getFlaggedAccounts (auth failure, empty installs/repos/active-users, query failures, row mapping with evidence filtering to maintainer repos, summary text per reason, severity defaulting to medium) and resolveFlaggedAccount (not found, wrong installation, missing or out-of-scope evidence, successful resolve with audit log and revalidation, persist failure).

Type of Change

  • Bug fix
  • New feature
  • UI / UX improvement
  • Refactor
  • Documentation
  • Other (unit tests)

Related Issue

Related to #885

What was changed?

New file src/app/actions/maintainer/flagged-accounts.test.ts with 14 tests, following the existing supabase-mock pattern used in ping-reviewers.test.ts and failed-events.test.ts.

Test plan: npx vitest run src/app/actions/maintainer/flagged-accounts.test.ts (14 passed), npx eslint on the new file (clean), npx tsc --noEmit (clean).

Screenshots

Not applicable.

Checklist

  • My code follows the project structure and conventions
  • I tested this locally (npm run dev equivalents: vitest, eslint, tsc)
  • No hardcoded secrets or credentials
  • I have updated documentation if needed
  • The linked issue has correct labels per Label Guide

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Hey @Ishaan-Gpt

You have 4 open PRs right now. The limit is 3 at a time.

Please get your existing PRs merged or closed before opening new ones:

This PR will remain open but won't be reviewed until you're under the limit. See our Contributing Guidelines for details.

This branch has not been deployed

No deployments
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