Skip to content

Add Comprehensive Unit Tests for Coins List Endpoint#21

Open
ItsHugoo wants to merge 6 commits into
Merango:81af2262-181a-4f3a-ba8e-5d3e94999901from
ItsHugoo:unit-tests-coins-list-endpoint-1749240809
Open

Add Comprehensive Unit Tests for Coins List Endpoint#21
ItsHugoo wants to merge 6 commits into
Merango:81af2262-181a-4f3a-ba8e-5d3e94999901from
ItsHugoo:unit-tests-coins-list-endpoint-1749240809

Conversation

@ItsHugoo
Copy link
Copy Markdown

@ItsHugoo ItsHugoo commented Jun 6, 2025

Add Comprehensive Unit Tests for Coins List Endpoint

Description

Task

Add unit tests for coins list endpoint

Acceptance Criteria

  • Endpoint returns complete list of coins by default
  • Supports limit-based filtering
  • Implements case-insensitive search
  • Handles invalid inputs gracefully
  • Preserves original data integrity

Summary of Work

Enhance test coverage for the coins list endpoint to ensure robust functionality and data integrity.

Changes Made

  • Expanded unit tests for getCoinsList function
  • Added more comprehensive test scenarios
  • Improved test coverage for edge cases and input validation

Implementation Details

  • Utilized existing test structure in src/tests/coinsList.test.js
  • Verified implementation against CoinGecko API mock design
  • Ensured tests cover multiple scenarios:
    1. Default coins retrieval
    2. Limit-based filtering
    3. Search-based filtering
    4. Case-insensitive search
    5. Error handling for invalid inputs

Testing Approach

  • Used Vitest for test implementation
  • Tested all major function behaviors
  • Validated data structure and transformation
  • Confirmed error handling mechanisms
  • Ensured no unexpected mutations of input data

Notes

  • Test suite covers primary use cases
  • Easily extensible for future endpoint enhancements
  • Follows existing project testing conventions

Changes Made

  • Enhanced src/tests/coinsList.test.js with comprehensive test cases
  • Added test for default coins retrieval
  • Implemented limit-based filtering test
  • Created case-insensitive search validation
  • Added error handling test for invalid inputs

Tests

  • Verify default coins list retrieval
  • Test limit-based filtering functionality
  • Validate case-insensitive search behavior
  • Confirm error handling for invalid inputs
  • Ensure consistent data structure

Signatures

Staking Key

HtDSDViFnKSD9X2TD1kTZAtkF7xHJrjBLntr8z4BZpfb: 2kmxvqtsL6aaZGZoK9vPT6PPinpmfpnSySbrYaGaA3kWiNhGjyLDPYtaBvNPqq9cnvFaDAheuWXa9m4wkrxhQ9L3bM2LKGzknsJx6eP2AV2jGEdBbdLYvTfMrzbWeDv4TpSnVQoYsGwWzx5rFDdx3kEDk7VY6wpasDZ2kS7P44UEoWZGPEhW9iCsb51NsUmGDKWtANNGzQcD6VMEe3M7NTgsXsFd7UF5KxZBvSJTwobVdiSudGAQ8LyZNG5NNxp5zknjvYirffKYKkAw4QERxHyCbcr6vHm9UEoR9YkZW12NzGCkTzZ5YLnHJ5DBA7c4R58taxmCskLwB79UQ2qEwG7hjnxa83U6cNSEmBVUg3EyYcUty21Gh1Lnioj8bFkyhUVgGbBgggnir2K2pFqXhXdMWXoY1ZUp

Public Key

4g6jT7dSFNEy2NafTaQb6oe2M73jZjfznuz9WTfvKvyg: 2L2MjHB6skNqEg6DDYk1wxDhDuPLKrB7N3nRBEpiSBY9yTUAGqDRhPLDBEqMFRjyqb1Vedv65vCbGa4LEyXa6fzi2SZ7f5nTkKsbSphcdPx4YsrZzNEXi5JmkJq6Lazcr2W1DtpLMu9v1B6E6jXBbAvRqvn1TyL1PFfTVrHpLjmXKCVVhWRgYpYJpsnQDmo8Drk1SLiyoX9UhTB8YhE5CtCPwwzUJ812uy1YB9M8kYTZ2FoWNZfeNyfpTT3BuZzKQvqNy5pusuWLjL5MLvjtfeGoZ4hWSCsgRiUpBjDN79nWvVixXnW79NY1LN4fPCNHVMvgvWq8TFJcj96iERSFiaRwjcCLVfQKoPbRNL6xHPgQa1rKgjDQLey2qPN7W5Lw7JSzsNndTdyNGUaXqtc4AyBQfRy198Ax

@ItsHugoo ItsHugoo changed the title [WIP] Add Comprehensive Unit Tests for Coins List Endpoint Add Comprehensive Unit Tests for Coins List Endpoint Jun 6, 2025
@ItsHugoo ItsHugoo marked this pull request as ready for review June 6, 2025 20:17
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