Skip to content

test: add unit tests for issues-helpers (re #885) - #902

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

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

Conversation

@Ishaan-Gpt

Copy link
Copy Markdown

Summary

Adds unit tests for the issue filter helpers in src/app/actions/issues-helpers.ts, covering one file from the #885 checklist (one test file per PR).

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/issues-helpers.test.ts (17 tests):

  • normalizeRepoFilter: passes plain values through, trims leading/trailing whitespace (spaces, tabs, newlines), preserves internal whitespace, returns null for undefined, empty, and whitespace-only input.
  • repoFilterPattern: leaves plain values untouched, escapes LIKE wildcards backslash, percent, and underscore (singly, repeatedly, and adjacent), trims before escaping, returns null for undefined, empty, and whitespace-only input.

Screenshots

Not applicable (no UI changes).

Checklist

  • My code follows the project structure and conventions
  • I tested this locally (npx vitest run src/app/actions/issues-helpers.test.ts - 17/17 pass, eslint and tsc clean)
  • No hardcoded secrets or credentials
  • I have updated documentation if needed

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