Skip to content

test: add e2e tests for gift-token endpoints#686

Open
pradhyumna186 wants to merge 1 commit intoGreenstand:mainfrom
pradhyumna186:feat/gift-token-tests
Open

test: add e2e tests for gift-token endpoints#686
pradhyumna186 wants to merge 1 commit intoGreenstand:mainfrom
pradhyumna186:feat/gift-token-tests

Conversation

@pradhyumna186
Copy link
Copy Markdown

Description

Add integration tests for the gift-token endpoints (POST /gift-token and GET /gift-token) as defined in the user-api.yaml specification (lines 29-66). These tests follow TDD approach and will pass once the endpoints are implemented.

The tests mock external dependencies:

  • generateGiftToken from packages/keycloak/generateGiftToken.ts
  • sendEmail from packages/common/sendEmail.ts

Resolves: # (related issue number if applicable)


Changes Made

  • Changes in apps folder (specify the app and briefly describe the
    changes):

    • User - Added tests/gift-token.spec.e2e.ts with integration tests for gift-token endpoints
    • Web
    • Native
  • Changes in packages folder (specify the package and briefly describe
    the changes):

    • Core

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 (changes)

Screenshots

N/A - Test file only, no UI changes


How Has This Been Tested?

  • Cypress integration
  • Cypress component tests
  • Jest unit tests

Tests can be run with:

Add integration tests for POST and GET /gift-token endpoints
as defined in user-api.yaml (lines 29-66).

- Mock generateGiftToken from packages/keycloak
- Mock sendEmail from packages/common
- Test success and error scenarios for sending gift tokens
- Test retrieval of sent gift tokens
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