Skip to content

Adds integration tests in `tests/integration/auth-jwt-validation.test… - #196

Open
aishagbadamosi wants to merge 1 commit into
StellarState:devfrom
aishagbadamosi:dev
Open

Adds integration tests in `tests/integration/auth-jwt-validation.test…#196
aishagbadamosi wants to merge 1 commit into
StellarState:devfrom
aishagbadamosi:dev

Conversation

@aishagbadamosi

Copy link
Copy Markdown

….ts` that verify all protected invoice endpoints return 401 Unauthorized when called without an Authorization header.

Adds integration tests in tests/integration/auth-jwt-validation.test.ts that verify all protected invoice endpoints return 401 Unauthorized when called without an Authorization header.

Endpoints covered:

  • GET /api/v1/invoices
  • POST /api/v1/invoices
  • GET /api/v1/invoices/:id
  • PUT /api/v1/invoices/:id
  • DELETE /api/v1/invoices/:id
  • POST /api/v1/invoices/:id/publish
  • POST /api/v1/invoices/:id/document

Closes #171

Description

Adds integration tests in tests/integration/auth-jwt-validation.test.ts that verify all protected invoice endpoints return 401 Unauthorized when called without an Authorization header.

Closes #171

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • All GitHub Actions workflows are green on this PR (required for merge)
  • Commit messages follow Conventional Commits (feat:, fix:, chore:, etc.) — enforced by CI
  • No secrets, API keys, .env, or credentials committed (see CONTRIBUTING.md)
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

How to Test

  1. Run npm test to execute all tests
  2. Or run specifically: npx jest tests/integration/auth-jwt-validation.test.ts

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Additional Notes

The tests cover all protected invoice endpoints: GET, POST, GET/:id, PUT/:id, DELETE/:id, POST/:id/publish, and POST/:id/document.

For Reviewers

  • Code quality and readability
  • Test coverage
  • Security implications
  • Performance impact
  • Breaking changes

….ts` that verify all protected invoice endpoints return 401 Unauthorized when called without an Authorization header.

Adds integration tests in `tests/integration/auth-jwt-validation.test.ts`
that verify all protected invoice endpoints return 401 Unauthorized when
called without an Authorization header.

Endpoints covered:
- GET /api/v1/invoices
- POST /api/v1/invoices
- GET /api/v1/invoices/:id
- PUT /api/v1/invoices/:id
- DELETE /api/v1/invoices/:id
- POST /api/v1/invoices/:id/publish
- POST /api/v1/invoices/:id/document

Closes StellarState#171
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@aishagbadamosi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chizzy192 chizzy192 closed this Jul 29, 2026
@chizzy192 chizzy192 reopened this Jul 29, 2026
@chizzy192
chizzy192 self-requested a review July 29, 2026 17:26
@chizzy192

Copy link
Copy Markdown
Contributor

Hi @aishagbadamosi, thank you for your contribution! 🙏

We noticed your PR is submitted from a branch also named dev (your fork's dev → upstream dev). Unfortunately, GitHub Actions cannot distinguish this from the base branch and suppresses workflow runs entirely for PRs submitted this way.

Please update your PR by:

  1. Create a new branch in your fork from your current dev:
    git checkout dev
    git checkout -b feat/auth-jwt-integration-tests
    git push origin feat/auth-jwt-integration-tests
  2. Update this PR's head branch to feat/auth-jwt-integration-tests (you can do this by closing this PR and opening a new one from the new branch, or by updating the branch via GitHub UI).

This will allow our CI workflows (API CI and Commitlint) to run on your changes. Thanks! 🚀

@chizzy192

Copy link
Copy Markdown
Contributor

Hi @aishagbadamosi! 👋

Conflict Summary & Action Required:
Your PR has 1 merge conflict against dev in tests/integration/auth-jwt-validation.test.ts and is submitted from head branch dev (aishagbadamosi:devStellarState:dev).

Rebase & Branch Rename Steps:

  1. Create a dedicated feature branch and push to your fork:
    git checkout dev
    git checkout -b feat/auth-jwt-validation-tests
    git fetch origin dev
    git rebase origin/dev
    # Reconcile tests/integration/auth-jwt-validation.test.ts
    git add tests/integration/auth-jwt-validation.test.ts
    git rebase --continue
    npm test
    git push origin feat/auth-jwt-validation-tests
  2. Update this PR head branch (or open a new PR) from feat/auth-jwt-validation-tests.

Thanks! 🚀

@chizzy192

Copy link
Copy Markdown
Contributor

Hi @aishagbadamosi! 👋

Here is a detailed breakdown of the issues on your PR and the exact steps to fix them:

📌 Issues Identified

  1. Branch Naming Conflict: Your PR is submitted from a branch named dev in your fork (aishagbadamosi:devStellarState:dev). GitHub Actions suppresses CI workflow runs when the head branch name equals the target default branch.
  2. File Conflict: tests/integration/auth-jwt-validation.test.ts exists on both dev and your branch.

🛠️ Step-by-Step Resolution

  1. Create a dedicated feature branch in your local clone and rebase onto dev:
    git checkout dev
    git checkout -b feat/auth-jwt-validation-tests
    git fetch origin dev
    git rebase origin/dev
  2. Resolve conflict in tests/integration/auth-jwt-validation.test.ts by integrating your JWT integration test assertions inside the main describe block on dev.
  3. Mark resolved, test, and push to your new fork branch:
    git add tests/integration/auth-jwt-validation.test.ts
    git rebase --continue
    npm test
    git push origin feat/auth-jwt-validation-tests
  4. Open or update your Pull Request using the head branch feat/auth-jwt-validation-tests.

This will enable full GitHub Actions CI validation on your PR. Thanks! 🚀

@chizzy192 chizzy192 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.

@chizzy192

Copy link
Copy Markdown
Contributor

Hi @aishagbadamosi! 👋

Rebase & Branch Rename Reminder:
Your PR has 1 merge conflict in tests/integration/auth-jwt-validation.test.ts and is submitted from head branch dev (aishagbadamosi:devStellarState:dev).

Quick Steps:

  1. Create a dedicated feature branch in your fork:
    git checkout dev
    git checkout -b feat/auth-jwt-validation-tests
    git fetch origin dev
    git rebase origin/dev
    # Reconcile tests/integration/auth-jwt-validation.test.ts
    git add tests/integration/auth-jwt-validation.test.ts
    git rebase --continue
    npm test
    git push origin feat/auth-jwt-validation-tests
  2. Update this PR head branch (or open a new PR) from feat/auth-jwt-validation-tests.

Thanks! 🚀

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.

[TESTING] Add integration test for missing Authorization header rejection

2 participants